:root {
  --paper: #fbf7ec;
  --paper-deep: #f5ead0;
  --surface: #fffefa;
  --ink: #050505;
  --muted: #4f4b43;
  --accent: #f5ad22;
  --accent-soft: #f8d98f;
  --line: #171717;
  --border: #efa51f;
  --danger: #d73f2f;
  --success: #25874d;
  --shadow: 0 18px 45px rgba(71, 53, 24, 0.12);
  --display: "Arial Black", Impact, "Microsoft YaHei", sans-serif;
  --text: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--text);
  letter-spacing: 0;
  background:
    radial-gradient(circle at 15% 5%, rgba(245, 173, 34, 0.1), transparent 22rem),
    linear-gradient(180deg, var(--paper), #fffaf0 60%, var(--paper));
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

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

.site-shell,
.admin-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.brand-rail {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 34px;
}

.year-badge {
  grid-column: 1;
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font-family: var(--display);
  font-size: 2.65rem;
  line-height: 1;
  white-space: nowrap;
}

.script-name {
  grid-column: 2;
  grid-row: 1;
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
  white-space: nowrap;
}

.rail-line {
  grid-column: 3;
  grid-row: 1;
  height: 12px;
  border-radius: 999px;
  background: var(--ink);
}

.rail-dots {
  grid-column: 4;
  grid-row: 1;
  display: inline-flex;
  gap: 22px;
}

.rail-dots i,
.side-dots span {
  display: block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--ink);
}

.rail-label {
  grid-column: 5;
  grid-row: 1;
  justify-self: end;
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.15rem;
  line-height: 1;
  white-space: nowrap;
}

.top-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 34px;
  align-items: center;
  padding-left: 16px;
  font-size: 0.96rem;
  font-weight: 700;
}

.top-nav a {
  position: relative;
  padding-bottom: 8px;
}

.top-nav a:hover::after,
.top-nav a:focus-visible::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--accent);
}

.floating-menu {
  position: fixed;
  top: 96px;
  bottom: 28px;
  left: 18px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 236px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  transition: width 180ms ease, padding 180ms ease, border-radius 180ms ease;
}

.floating-menu-toggle,
.floating-menu a,
.floating-menu-brand {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}

.floating-menu-head {
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(239, 165, 31, 0.34);
}

.floating-menu-brand {
  gap: 10px;
  padding: 4px 6px;
}

.floating-menu-mark {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
  font-size: 0.86rem;
}

.floating-menu-title,
.floating-menu-copy {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.floating-menu-title strong,
.floating-menu-copy strong {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-menu-title small,
.floating-menu-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-menu-toggle {
  justify-content: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.floating-menu nav {
  display: grid;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}

.floating-menu a {
  gap: 10px;
  padding: 0 10px;
}

.floating-menu a:hover,
.floating-menu a:focus-visible,
.floating-menu-toggle:hover,
.floating-menu-toggle:focus-visible,
.floating-menu a.is-active {
  border-color: rgba(239, 165, 31, 0.52);
  background: rgba(245, 173, 34, 0.13);
}

.floating-menu a.is-active .floating-menu-icon {
  color: #fff;
  background: var(--accent);
}

.floating-menu-icon {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  padding: 2px;
  border-radius: 7px;
  color: var(--ink);
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.floating-menu-link {
  display: inline-flex;
  align-items: center;
}

.floating-menu.is-collapsed {
  width: 68px;
  padding: 12px 10px;
  border-radius: 20px;
}

.floating-menu.is-collapsed .floating-menu-head {
  padding-bottom: 8px;
}

.floating-menu.is-collapsed .floating-menu-brand,
.floating-menu.is-collapsed .floating-menu-toggle,
.floating-menu.is-collapsed a {
  justify-content: center;
  min-height: 46px;
  padding: 0;
}

.floating-menu.is-collapsed .floating-menu-toggle .floating-menu-icon {
  transform: rotate(180deg);
}

.floating-menu.is-collapsed .floating-menu-title,
.floating-menu.is-collapsed .floating-menu-copy,
.floating-menu.is-collapsed .floating-menu-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(300px, 0.78fr) 34px;
  gap: 42px;
  align-items: start;
  min-height: 520px;
  margin-bottom: 28px;
}

.side-dots {
  position: absolute;
  top: 46%;
  left: -16px;
  display: grid;
  gap: 12px;
}

.side-dots span {
  width: 10px;
  height: 10px;
  border: 3px solid var(--accent);
  background: transparent;
}

.hero-copy {
  min-width: 0;
  padding-left: 42px;
  padding-top: 42px;
}

.hero-year {
  margin: 0 0 2px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 5.7rem;
  line-height: 0.95;
}

.hero-copy h1 {
  max-width: 620px;
  margin: 0 0 46px;
  color: var(--accent);
  font-family: var(--display);
  font-size: 4.85rem;
  line-height: 0.9;
}

.identity-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.identity-line > strong,
.identity-line > span {
  display: inline-block;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
  font-size: 2.7rem;
  line-height: 1.05;
  padding: 0 8px 4px;
}

.identity-line > strong {
  color: var(--ink);
  background: transparent;
  padding-left: 0;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  align-items: center;
  max-width: 100%;
  margin: 0 0 24px;
  font-size: 1.35rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.role-tags span,
.role-tags b {
  display: inline-block;
}

.hero-summary {
  max-width: 560px;
  margin: 0;
  padding-left: 16px;
  border-left: 10px solid var(--accent);
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 22px;
}

.portfolio-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-weight: 950;
}

.portfolio-actions span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 850;
}

.site-shell .rich-emphasis,
.preview-panel .rich-emphasis {
  color: inherit;
  font-weight: 950;
  text-shadow: 0.018em 0 currentColor;
  background: linear-gradient(transparent 58%, rgba(245, 173, 34, 0.34) 58%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.rich-content-image {
  margin: 14px 0;
}

.rich-content-image img {
  display: block;
  width: min(100%, 560px);
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.timeline .rich-content-image img,
.summary-copy .rich-content-image img {
  max-width: 100%;
}

.mini-card .rich-content-image {
  margin: 8px 0 0;
}

.mini-card .rich-content-image img {
  max-height: 110px;
}

.hero-media {
  position: relative;
  align-self: start;
  height: 520px;
  min-height: 0;
}

.hero-media::before {
  position: absolute;
  inset: 34px -18px -24px 22px;
  z-index: 0;
  content: "";
  border-radius: 8px;
  background: var(--accent);
  transform: rotate(-3deg);
}

.hero-media img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.vertical-note {
  margin: 0;
  writing-mode: vertical-rl;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.5;
}

.section-stack {
  display: grid;
  gap: 42px;
}

.content-panel {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
  padding: 56px 64px;
  border: 2px solid var(--border);
  border-radius: 70px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.content-panel::before {
  position: absolute;
  inset: 18px -28px -18px -34px;
  z-index: -1;
  content: "";
  border: 2px solid var(--border);
  border-radius: 58px;
  background: rgba(245, 173, 34, 0.35);
  transform: rotate(1.5deg);
}

.panel-heading span {
  display: block;
  color: var(--accent);
  font-family: var(--display);
  font-size: 3.2rem;
  line-height: 1;
}

.panel-heading h2 {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: 2.05rem;
  line-height: 1.05;
}

.panel-body {
  min-width: 0;
}

.summary-copy {
  display: grid;
  gap: 14px;
}

.summary-copy p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.85;
  font-weight: 700;
}

.intent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 26px;
  align-items: start;
}

.intent-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}

.intent-item {
  min-width: 0;
  padding: 16px 0 0;
  border-top: 5px solid var(--ink);
}

.intent-item span {
  display: block;
  color: var(--accent);
  font-family: var(--display);
  font-size: 0.94rem;
  line-height: 1;
}

.intent-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1.06rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.certification-panel {
  min-width: 0;
}

.certification-heading {
  display: flex;
  gap: 10px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}

.certification-heading span {
  color: var(--accent);
  font-family: var(--display);
  font-size: 0.82rem;
}

.certification-heading strong {
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1;
}

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

.certificate-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(245, 173, 34, 0.12);
}

.certificate-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 8px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1;
  text-align: center;
}

.certificate-copy {
  min-width: 0;
}

.certificate-copy strong {
  display: block;
  font-size: 1rem;
  line-height: 1.35;
}

.certificate-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 700;
}

.intent-highlights {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}

.intent-highlights li {
  margin-bottom: 4px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 30px;
  padding-left: 28px;
  border-left: 1px solid #cfc4ad;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  position: absolute;
  top: 2px;
  left: -37px;
  width: 14px;
  height: 14px;
  content: "";
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.98rem;
  font-weight: 900;
}

.item-meta > span,
.item-meta > strong {
  padding-right: 18px;
  border-right: 2px solid var(--ink);
}

.item-meta > span:last-child,
.item-meta > strong:last-child {
  padding-right: 0;
  border-right: 0;
}

.timeline ul {
  margin: 0;
  padding-left: 19px;
}

.timeline li {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 650;
}

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

.skill-group h3 {
  display: inline-block;
  min-width: 112px;
  margin: 0 0 18px;
  padding: 6px 16px;
  border-radius: 6px;
  background: var(--accent);
  font-size: 1rem;
  text-align: center;
}

.skill-row {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) 108px;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.92rem;
  font-weight: 700;
}

.skill-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dedbd5;
}

.skill-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.footer-block {
  margin-top: 42px;
}

.contact-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 36px;
  align-items: center;
  padding: 14px 26px;
  border-top: 12px solid #d6d6d6;
  border-radius: 7px;
  color: #fff;
  background: #000;
  font-family: "Courier New", monospace;
  font-size: 1.18rem;
  font-weight: 800;
}

.contact-strip > strong {
  font-size: 1.55rem;
}

.copyright {
  margin: 16px 0 0;
  color: #777064;
  text-align: center;
  font-size: 0.9rem;
}

.knowledge-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 173, 34, 0.14), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(5, 5, 5, 0.06), transparent 26rem),
    linear-gradient(180deg, var(--paper), #fffaf0 62%, var(--paper-deep));
}

.kb-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.kb-brand {
  margin-bottom: 28px;
}

.kb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr);
  gap: 34px;
  align-items: stretch;
  margin-bottom: 34px;
}

.kb-hero-copy {
  min-width: 0;
  padding: 58px 42px 52px;
  border: 2px solid var(--border);
  border-radius: 64px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kb-project-meta {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 6px 12px;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1;
}

.kb-hero h1 {
  max-width: 760px;
  margin: 0 0 22px;
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(3.4rem, 7vw, 6.8rem);
  line-height: 0.9;
}

.kb-hero-copy > p:not(.kb-project-meta) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
  font-weight: 750;
}

.kb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.kb-primary-link,
.kb-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 950;
}

.kb-primary-link {
  color: #fff;
  background: var(--ink);
}

.kb-secondary-link {
  color: var(--ink);
  background: transparent;
}

.kb-system-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 28px;
  border: 2px solid var(--ink);
  border-radius: 36px;
  background: rgba(255, 254, 250, 0.94);
  box-shadow: var(--shadow);
}

.kb-status-line {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  font-weight: 950;
}

.kb-status-line span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(245, 173, 34, 0.18);
}

.kb-status-line span.is-online {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(37, 135, 77, 0.14);
}

.kb-pipeline {
  display: grid;
  gap: 12px;
}

.kb-pipeline article {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(239, 165, 31, 0.58);
  border-radius: 8px;
  background: rgba(245, 173, 34, 0.1);
}

.kb-pipeline article span {
  grid-row: span 2;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1;
}

.kb-pipeline article strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.kb-pipeline article p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 700;
}

.kb-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-stack span {
  padding: 5px 9px;
  border: 1px solid rgba(5, 5, 5, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 850;
}

.kb-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.kb-mobile-switch {
  display: none;
}

.kb-mobile-scope,
.kb-mobile-chat-head {
  display: none;
}

.kb-library,
.kb-chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: clamp(560px, 68vh, 720px);
  scroll-margin-top: 24px;
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 34px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
}

.kb-library {
  position: sticky;
  top: 24px;
  padding: 24px;
}

.kb-chat-panel {
  padding: 26px;
}

.kb-section-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 18px;
}

.kb-section-heading span {
  color: var(--accent);
  font-family: var(--display);
  font-size: 2.2rem;
  line-height: 1;
}

.kb-section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1;
}

.kb-filter,
.kb-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.kb-filter button,
.kb-samples button {
  min-height: 34px;
  border: 1px solid rgba(5, 5, 5, 0.16);
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
  font-size: 0.84rem;
  font-weight: 850;
  cursor: pointer;
}

.kb-filter button {
  padding: 0 10px;
}

.kb-samples button {
  padding: 0 12px;
}

.kb-filter button:hover,
.kb-filter button:focus-visible,
.kb-filter button.is-active,
.kb-samples button:hover,
.kb-samples button:focus-visible {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.kb-doc-list {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.kb-doc-card {
  padding: 14px;
  border: 1px solid #ead8ae;
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.72);
}

.kb-doc-card > div:first-child {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kb-doc-card span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 950;
}

.kb-doc-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.kb-doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
  font-weight: 700;
}

.kb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.kb-tags em {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
}

.kb-chat-log {
  display: grid;
  flex: 1 1 auto;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 18px 0;
}

.kb-message {
  display: grid;
  gap: 8px;
  width: min(88%, 760px);
  padding: 14px 16px;
  border: 1px solid #ead8ae;
  border-radius: 10px;
  background: #fff;
}

.kb-message > strong {
  color: var(--accent);
  font-family: var(--display);
  font-size: 0.9rem;
  line-height: 1;
}

.kb-message div,
.kb-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 700;
}

.kb-message.is-user {
  justify-self: end;
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.kb-message.is-user > strong,
.kb-message.is-user div {
  color: #fff;
}

.kb-message.is-warning {
  border-color: rgba(215, 63, 47, 0.38);
  background: rgba(215, 63, 47, 0.08);
}

.kb-message.is-loading p {
  color: var(--ink);
}

.kb-sources {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed #d9c79d;
}

.kb-sources > span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 950;
}

.kb-sources a {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: rgba(245, 173, 34, 0.1);
}

.kb-sources a strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.kb-sources a small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  font-weight: 700;
}

.kb-question-form {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: stretch;
  margin-top: 18px;
}

.kb-question-input {
  position: relative;
  display: block;
  min-width: 0;
}

.kb-question-form textarea {
  width: 100%;
  min-height: 76px;
  padding: 12px 14px 30px;
  resize: vertical;
  border: 1px solid #cfc8ba;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-size: 0.96rem;
  line-height: 1.6;
}

.kb-question-input span {
  position: absolute;
  right: 12px;
  bottom: 9px;
  pointer-events: none;
  color: #8a806f;
  font-size: 0.74rem;
  font-weight: 850;
}

.kb-question-form button {
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  font-weight: 950;
  cursor: pointer;
}

.kb-question-form button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.kb-error {
  margin: 0;
  color: var(--danger);
  font-weight: 850;
}

.kb-strip {
  margin-top: 34px;
}

.admin-body {
  background:
    radial-gradient(circle at 80% 20%, rgba(245, 173, 34, 0.12), transparent 22rem),
    linear-gradient(180deg, var(--paper), #fffaf1);
}

.admin-brand {
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
}

.admin-sidebar h1 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: 2.35rem;
  line-height: 1;
}

.back-home,
.admin-sidebar nav a,
.admin-actions button,
.add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.back-home {
  width: 100%;
  margin-bottom: 28px;
}

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

.admin-sidebar nav a {
  justify-content: flex-start;
  gap: 14px;
  min-height: 48px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.6);
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a:focus-visible {
  background: var(--accent);
}

.admin-sidebar nav strong {
  font-family: var(--display);
  font-size: 1.3rem;
}

.admin-hint {
  margin: 64px 0 0;
  padding-left: 18px;
  border-left: 8px dotted var(--accent);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.format-hint {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px dashed #ead8ae;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 250, 239, 0.72);
  font-size: 0.92rem;
  line-height: 1.7;
  font-weight: 700;
}

.format-hint strong {
  color: var(--ink);
  font-weight: 900;
}

.format-hint code {
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  background: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}

.admin-panel {
  position: relative;
  padding: 36px 48px 40px;
  border: 2px solid var(--border);
  border-radius: 66px;
  background: rgba(255, 254, 250, 0.96);
  box-shadow: var(--shadow);
}

.admin-panel::before {
  position: absolute;
  inset: 18px -24px -16px -28px;
  z-index: -1;
  content: "";
  border: 2px solid var(--border);
  border-radius: 56px;
  background: rgba(245, 173, 34, 0.3);
  transform: rotate(-1.6deg);
}

.admin-section {
  padding: 0 0 26px;
  margin-bottom: 24px;
  border-bottom: 1px dashed #cfc4ad;
}

.admin-section h2 {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 0 0 18px;
  font-size: 1.28rem;
}

.admin-section h2 span {
  font-family: var(--display);
  font-size: 1.75rem;
}

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

.field,
.inline-field {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.full-field {
  margin-top: 12px;
}

.field-grid > .full-field {
  grid-column: 1 / -1;
  margin-top: 0;
}

.field input,
.field textarea,
.inline-field input,
.skill-edit-row input[type="text"] {
  width: 100%;
  border: 1px solid #cfc8ba;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.field input,
.inline-field input,
.skill-edit-row input[type="text"] {
  min-height: 38px;
  padding: 8px 10px;
}

.field textarea {
  min-height: 118px;
  padding: 10px 12px;
  resize: vertical;
}

.rich-editor {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfc8ba;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.rich-editor.is-singleline {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: stretch;
}

.rich-editor.is-multiline .rich-toolbar {
  border-bottom: 1px solid #eadfca;
}

.rich-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 5px;
  background: #fff8e9;
}

.rich-editor.is-singleline .rich-toolbar {
  border-right: 1px solid #eadfca;
}

.rich-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(5, 5, 5, 0.16);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.rich-tool:hover,
.rich-tool:focus-visible,
.rich-tool.is-active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.rich-input {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  outline: none;
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  user-select: text;
}

.rich-input * {
  user-select: text;
}

.rich-editor.is-singleline .rich-input {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.rich-editor.is-multiline .rich-input {
  min-height: calc((1.45em * var(--rich-rows, 4)) + 20px);
}

.rich-input strong,
.rich-input b {
  font-weight: 900;
}

.rich-input img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 8px 0;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.rich-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 173, 34, 0.18);
}

.entry-list,
.skill-edit-list {
  display: grid;
  gap: 14px;
}

.entry-editor {
  padding: 14px;
  border: 1px solid #ead8ae;
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.7);
}

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

.entry-header strong {
  font-family: var(--display);
}

.entry-header > button,
.skill-edit-row > button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(215, 63, 47, 0.35);
  border-radius: 6px;
  color: var(--danger);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.add-button {
  min-height: 36px;
  margin-top: 12px;
  padding: 0 18px;
  color: var(--accent);
  background: #fff;
}

.add-button.compact {
  min-height: 32px;
  margin-top: 8px;
  font-size: 0.88rem;
}

.skill-editor .entry-header {
  align-items: end;
}

.skill-editor .inline-field {
  width: min(340px, 100%);
}

.skill-edit-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.skill-edit-row label {
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr) 52px;
  gap: 10px;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 800;
}

.skill-edit-row input[type="range"] {
  accent-color: var(--accent);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

.password-field {
  display: grid;
  gap: 6px;
  min-width: 180px;
  font-size: 0.86rem;
  font-weight: 800;
}

.password-field input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cfc8ba;
  border-radius: 6px;
  background: #fff;
}

.admin-actions button {
  min-width: 136px;
  padding: 0 20px;
  background: #fff;
}

.admin-actions .primary-action {
  color: #fff;
  background: var(--accent);
}

.save-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 6px;
  color: var(--success);
  background: rgba(37, 135, 77, 0.1);
  font-weight: 800;
}

.save-status.is-error {
  color: var(--danger);
  background: rgba(215, 63, 47, 0.1);
}

.preview-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.84);
  box-shadow: var(--shadow);
}

.preview-panel h2 {
  margin: 0 0 18px;
  font-size: 1.1rem;
}

.mini-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
}

.mini-rail {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 18px;
  font-family: var(--display);
  color: var(--accent);
}

.mini-rail > strong {
  padding: 4px 7px;
  color: #fff;
  background: var(--accent);
}

.mini-body {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 16px;
  align-items: center;
}

.mini-body p,
.mini-body h3 {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  line-height: 1;
}

.mini-body p {
  font-size: 2rem;
}

.mini-body h3 {
  margin-bottom: 14px;
  font-size: 1.42rem;
}

.mini-body > div > strong {
  display: inline-block;
  padding: 2px 6px 4px;
  color: #fff;
  background: var(--ink);
  font-family: var(--display);
}

.mini-body > div > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  font-weight: 800;
}

.mini-body img {
  width: 112px;
  height: 146px;
  object-fit: cover;
  border: 1px solid var(--ink);
  border-radius: 6px;
}

.mini-card > p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  font-weight: 700;
}

.admin-strip {
  margin-top: 34px;
}

:focus-visible {
  outline: 3px solid rgba(245, 173, 34, 0.55);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  .hero-section {
    grid-template-columns: minmax(0, 1fr) 36%;
  }

  .vertical-note {
    display: none;
  }

  .content-panel {
    grid-template-columns: 180px minmax(0, 1fr);
    padding: 46px 44px;
  }

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

  .intent-layout {
    grid-template-columns: 1fr;
  }

  .kb-hero,
  .kb-workspace {
    grid-template-columns: 1fr;
  }

  .kb-library {
    position: static;
  }

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

  .preview-panel {
    position: static;
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  .site-shell,
  .admin-shell,
  .kb-shell {
    width: min(100% - 28px, 720px);
    padding-top: 20px;
  }

  .brand-rail,
  .admin-brand {
    grid-template-columns: auto auto 1fr;
    gap: 12px;
  }

  .rail-label {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }

  .rail-dots {
    display: none;
  }

  .year-badge {
    min-height: 48px;
    font-size: 2rem;
  }

  .script-name,
  .rail-label {
    font-size: 1.7rem;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
  }

  .hero-copy {
    padding-left: 0;
    padding-top: 0;
  }

  .hero-year {
    font-size: 4rem;
  }

  .hero-copy h1 {
    margin-bottom: 26px;
    font-size: 3.6rem;
  }

  .identity-line > strong,
  .identity-line > span {
    font-size: 2.05rem;
  }

  .hero-media,
  .hero-media img {
    min-height: 420px;
  }

  .content-panel {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 34px 26px;
    border-radius: 44px;
  }

  .content-panel::before {
    inset: 12px -12px -12px -14px;
    border-radius: 40px;
  }

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

  .admin-sidebar,
  .preview-panel {
    position: static;
  }

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

  .admin-panel {
    padding: 30px 22px;
    border-radius: 38px;
  }

  .admin-panel::before {
    inset: 12px -10px -12px -12px;
    border-radius: 36px;
  }

  .preview-panel {
    grid-column: auto;
  }

  .contact-strip {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .kb-hero-copy {
    padding: 40px 28px;
    border-radius: 44px;
  }

  .kb-system-panel,
  .kb-library,
  .kb-chat-panel {
    border-radius: 28px;
  }

  .kb-chat-log {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .site-shell,
  .kb-shell {
    width: min(100% - 24px, 430px);
    padding-bottom: 112px;
  }

  .knowledge-body .kb-shell {
    width: min(100% - 16px, 460px);
    padding-top: 8px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .floating-menu {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(78vh, 520px);
    padding: 12px;
    border-radius: 22px;
    transition: max-height 180ms ease, padding 180ms ease, border-radius 180ms ease;
  }

  .floating-menu.is-collapsed {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    width: auto;
    max-height: 66px;
    padding: 8px;
    border-radius: 20px;
  }

  .floating-menu.is-collapsed .floating-menu-head {
    display: none;
  }

  .floating-menu.is-collapsed nav {
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px;
    scrollbar-width: none;
  }

  .floating-menu.is-collapsed nav::-webkit-scrollbar {
    display: none;
  }

  .floating-menu.is-collapsed .floating-menu-brand,
  .floating-menu.is-collapsed .floating-menu-toggle,
  .floating-menu.is-collapsed a {
    flex: 0 0 34px;
    width: 34px;
    min-height: 44px;
  }

  .floating-menu.is-collapsed .floating-menu-toggle {
    flex-basis: 38px;
    width: 38px;
    margin-top: 0;
  }

  .floating-menu:not(.is-collapsed) nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .floating-menu:not(.is-collapsed) .floating-menu-toggle {
    margin-top: 0;
  }

  .floating-menu:not(.is-collapsed) .floating-menu-brand,
  .floating-menu:not(.is-collapsed) .floating-menu-toggle,
  .floating-menu:not(.is-collapsed) a {
    min-height: 46px;
  }

  .brand-rail {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px 12px;
    margin-bottom: 22px;
  }

  .year-badge {
    min-height: 46px;
    padding: 0 12px;
    font-size: clamp(1.72rem, 8.2vw, 2rem);
  }

  .script-name {
    justify-self: end;
    font-size: clamp(1.3rem, 6.4vw, 1.6rem);
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 14px;
    padding-left: 0;
  }

  .top-nav a {
    white-space: nowrap;
  }

  .rail-label {
    grid-row: 2;
    font-size: clamp(1.25rem, 6vw, 1.45rem);
  }

  .rail-line {
    display: none;
  }

  .hero-section {
    gap: 22px;
    margin-bottom: 24px;
  }

  .hero-copy {
    padding: 0;
  }

  .hero-year {
    font-size: clamp(2.2rem, 14vw, 3.1rem);
  }

  .hero-copy h1 {
    max-width: 100%;
    margin-bottom: 22px;
    font-size: clamp(2.18rem, 12vw, 2.75rem);
    overflow-wrap: break-word;
  }

  .identity-line {
    gap: 8px;
  }

  .identity-line > strong,
  .identity-line > span {
    font-size: clamp(1.48rem, 8vw, 2rem);
  }

  .role-tags {
    font-size: 1.05rem;
    line-height: 1.55;
    word-break: normal;
  }

  .hero-summary {
    max-width: 100%;
    padding-left: 12px;
    border-left-width: 7px;
    font-size: 0.96rem;
    word-break: break-word;
  }

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

  .portfolio-actions a {
    justify-content: center;
    width: 100%;
  }

  .hero-media {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }

  .hero-media::before {
    inset: 22px -9px -13px 13px;
  }

  .hero-media img {
    min-height: 0;
  }

  .kb-brand {
    display: none;
  }

  .kb-hero {
    display: none;
  }

  .kb-hero-copy {
    padding: 20px 16px;
    border-radius: 22px;
  }

  .kb-project-meta {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  .kb-hero h1 {
    margin-bottom: 12px;
    font-size: clamp(2.2rem, 13vw, 3rem);
  }

  .kb-hero-copy > p:not(.kb-project-meta) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.96rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .kb-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 18px;
  }

  .kb-primary-link,
  .kb-secondary-link {
    width: 100%;
  }

  .kb-system-panel {
    gap: 12px;
  }

  .kb-system-panel,
  .kb-library,
  .kb-chat-panel {
    padding: 16px;
    border-radius: 22px;
  }

  .kb-status-line {
    padding-bottom: 10px;
    font-size: 0.92rem;
  }

  .kb-pipeline {
    grid-auto-columns: minmax(128px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .kb-pipeline article {
    grid-template-columns: 1fr;
    min-width: 128px;
    scroll-snap-align: start;
  }

  .kb-pipeline article span {
    grid-row: auto;
    font-size: 1.35rem;
  }

  .kb-pipeline article p {
    font-size: 0.78rem;
  }

  .kb-stack {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .kb-stack span {
    flex: 0 0 auto;
  }

  .kb-workspace {
    display: grid;
    gap: 10px;
    min-height: calc(100svh - 22px);
  }

  .kb-mobile-switch {
    display: none;
  }

  .kb-mobile-scope {
    position: sticky;
    top: 0;
    z-index: 6;
    display: grid;
    gap: 7px;
    padding: 10px 10px 8px;
    border: 2px solid var(--ink);
    border-radius: 20px;
    background:
      linear-gradient(135deg, rgba(245, 173, 34, 0.18), rgba(255, 254, 250, 0.96) 58%),
      rgba(255, 254, 250, 0.96);
    box-shadow: 0 10px 26px rgba(30, 23, 11, 0.08);
  }

  .kb-mobile-titlebar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
  }

  .kb-mobile-titlebar > div {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .kb-mobile-titlebar small {
    color: var(--accent);
    font-family: "Courier New", monospace;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
  }

  .kb-mobile-titlebar strong {
    color: var(--ink);
    font-family: var(--display);
    font-size: clamp(1.42rem, 6.6vw, 1.78rem);
    line-height: 1;
    overflow-wrap: anywhere;
  }

  .kb-mobile-titlebar a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 11px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    color: #fff;
    background: var(--ink);
    font-size: 0.78rem;
    font-weight: 950;
  }

  .kb-mobile-scope-meta {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kb-library {
    display: none;
    height: min(66svh, 510px);
    min-height: 420px;
    scroll-margin-top: 62px;
  }

  .kb-chat-panel {
    height: calc(100svh - 166px);
    min-height: 520px;
    padding: 12px;
    scroll-margin-top: 0;
  }

  .kb-mobile-chat-head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    min-height: 28px;
    margin-bottom: 8px;
  }

  .kb-mobile-chat-head span {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 950;
  }

  .kb-mobile-chat-head strong {
    max-width: 54%;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kb-section-heading span {
    font-size: 1.72rem;
  }

  .kb-section-heading h2 {
    font-size: 1.42rem;
  }

  .kb-section-heading {
    margin-bottom: 8px;
  }

  .kb-chat-panel .kb-section-heading {
    display: none;
  }

  .kb-filter,
  .kb-samples {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    margin: 0 -10px 10px;
    padding: 0 10px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .kb-filter::-webkit-scrollbar,
  .kb-samples::-webkit-scrollbar,
  .kb-pipeline::-webkit-scrollbar,
  .kb-stack::-webkit-scrollbar {
    display: none;
  }

  .kb-filter button,
  .kb-samples button {
    flex: 0 0 auto;
    min-height: 38px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .kb-filter button {
    padding: 0 14px;
  }

  .kb-samples button {
    max-width: min(76vw, 320px);
    padding: 0 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .kb-doc-card > div:first-child {
    display: grid;
    justify-content: start;
  }

  .kb-doc-card {
    padding: 12px;
  }

  .kb-doc-card p {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.58;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
  }

  .kb-chat-log {
    gap: 10px;
    padding-right: 0;
  }

  .kb-message {
    width: 100%;
    padding: 12px 12px;
  }

  .kb-message div,
  .kb-message p {
    line-height: 1.62;
  }

  .kb-question-form {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
    margin-top: 10px;
  }

  .kb-question-form textarea {
    min-height: 62px;
    max-height: 140px;
    resize: none;
    padding: 10px 10px 27px;
  }

  .kb-question-form button {
    min-height: 62px;
  }

  .kb-strip {
    display: none;
  }

  .content-panel {
    gap: 18px;
    padding: 26px 18px;
    border-radius: 28px;
    overflow: hidden;
  }

  .content-panel::before {
    display: none;
  }

  .panel-heading span {
    font-size: 2.55rem;
  }

  .panel-heading h2 {
    font-size: 1.8rem;
  }

  .intent-board {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .intent-item {
    padding-top: 13px;
  }

  .certification-heading {
    display: grid;
    gap: 8px;
    justify-content: start;
  }

  .certificate-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .certificate-mark {
    width: max-content;
    min-width: 78px;
  }

  .item-meta {
    display: grid;
    gap: 6px;
    font-size: 0.95rem;
  }

  .item-meta > span,
  .item-meta > strong {
    padding-right: 0;
    border-right: 0;
  }

  .skills-grid,
  .field-grid,
  .admin-sidebar nav,
  .skill-edit-row,
  .skill-edit-row label {
    grid-template-columns: 1fr;
  }

  .skill-row {
    grid-template-columns: 1fr;
  }

  .timeline {
    gap: 24px;
    padding-left: 18px;
  }

  .timeline-item::before {
    left: -27px;
  }

  .timeline ul {
    padding-left: 16px;
  }

  .timeline li,
  .summary-copy p {
    overflow-wrap: anywhere;
  }

  .skill-track {
    width: 100%;
  }

  .contact-strip {
    padding: 12px 14px;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .contact-strip > strong {
    font-size: 1.18rem;
  }

  .side-dots {
    display: none;
  }

  .admin-actions button,
  .password-field,
  .save-status {
    width: 100%;
  }

  .admin-hint {
    max-width: 315px;
    word-break: break-all;
  }
}
