:root {
  --paper: #f8fafd;
  --panel: #ffffff;
  --surface: #fffdf7;
  --surface-soft: #fef7e0;
  --ink: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --line-strong: #bdc1c6;
  --green: #fff51f;
  --green-soft: #fff7d6;
  --blue: #1a73e8;
  --blue-soft: #e8f0fe;
  --amber: #2f3033;
  --amber-soft: #fef3c7;
  --red: #d93025;
  --red-soft: #fce8e6;
  --black: #202124;
  --shadow: 0 1px 2px rgba(60, 64, 67, .16), 0 2px 6px rgba(60, 64, 67, .12);
  --shadow-strong: 0 2px 4px rgba(60, 64, 67, .16), 0 8px 24px rgba(60, 64, 67, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 245, 31, .14) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 245, 31, .14) 1px, transparent 1px) 0 0 / 28px 28px,
    #fffef8;
  color: var(--ink);
  font-family: "Roboto", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body.menu-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.18;
  text-align: left;
}

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

.app-layout {
  width: calc(100% - 32px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 0 52px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.app-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.site-sidebar {
  position: sticky;
  top: 18px;
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.site-sidebar {
  scrollbar-width: none;
}

.site-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-brand {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sitemap-nav {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.sitemap-nav section {
  display: grid;
  gap: 6px;
}

.sitemap-nav p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sitemap-nav a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  line-height: 1.35;
}

.sitemap-nav a:hover,
.sitemap-nav a:focus-visible {
  background: var(--green-soft);
  color: var(--green);
  outline: none;
}

.admin-sidebar .sitemap-nav a:hover,
.admin-sidebar .sitemap-nav a:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

.mobile-menu-button,
.mobile-menu-backdrop {
  display: none;
}

.home-search {
  min-height: auto;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.compact-brand {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #d9ff74;
  color: var(--black);
  font-weight: 900;
}

.brand strong {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.home-copy {
  width: 100%;
  max-width: 760px;
  display: grid;
  gap: 8px;
}

.home-copy p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.home-tools {
  width: 100%;
  max-width: 840px;
  display: grid;
  gap: 14px;
}

.home-start {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.start-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 9px;
  min-height: 168px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.start-card.primary {
  border-color: rgba(249, 171, 0, .55);
  background: var(--green-soft);
}

.start-card:hover,
.start-card:focus-visible {
  transform: translateY(-1px);
  border-color: var(--black);
  box-shadow: var(--shadow-strong);
  outline: none;
}

.start-card span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--black);
  color: #ffffff;
  font-weight: 900;
}

.start-card strong {
  font-size: 17px;
  line-height: 1.35;
}

.start-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.search-band label,
.hero-chat-form label,
.message-builder label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.search-row,
.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  border: 2px solid var(--black);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.search-row input,
.chat-input-row input {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 10px;
  font-size: 18px;
}

.search-row button,
.chat-input-row button,
.primary-button,
.filter {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid var(--black);
  padding: 0 14px;
  background: var(--black);
  color: #ffffff;
  font-weight: 900;
}

.search-row button {
  width: 44px;
  padding: 0;
  background: #ffffff;
  color: var(--ink);
}

.chat-input-row button:hover,
.primary-button:hover,
.filter:hover,
.search-row button:hover,
.quick-card:hover,
.home-links button:hover {
  transform: translateY(-1px);
}

.search-results,
.compact-log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.search-results:empty,
.compact-log:empty {
  display: none;
}

.result-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  text-align: left;
}

.result-item span,
.tag {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.result-item strong {
  font-size: 15px;
}

.result-item p,
.result-item small {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-chat {
  display: grid;
  gap: 8px;
}

.bubble {
  max-width: 86%;
  padding: 12px;
  border-radius: 8px;
  line-height: 1.6;
}

.bubble.assistant {
  justify-self: start;
  background: var(--panel);
  border: 1px solid var(--line);
}

.bubble.user {
  justify-self: end;
  background: var(--green);
  color: #ffffff;
}

.bubble small {
  display: block;
  margin-top: 8px;
  color: inherit;
  opacity: .75;
  font-weight: 900;
}

.home-links {
  display: flex;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.home-links button {
  border: 0;
  border-bottom: 2px solid currentColor;
  background: transparent;
  color: var(--black);
  padding: 5px 2px;
  font-weight: 900;
}

.home-security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.home-security p {
  margin: 0;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d9ff74;
  box-shadow: 0 0 0 5px rgba(217, 255, 116, .22);
}

.fold-stack {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.public-page .fold-panel {
  display: none;
}

.public-page .fold-panel.active-page {
  display: block;
}

.public-page.section-page .home-search {
  display: none;
}

.public-page.section-page .fold-stack {
  padding-top: 0;
}

.fold-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 36px rgba(24, 33, 29, .06);
  overflow: hidden;
}

.fold-panel summary {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  list-style: none;
  cursor: pointer;
}

.fold-panel summary::-webkit-details-marker {
  display: none;
}

.fold-panel summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
}

.fold-panel[open] summary::after {
  content: "-";
}

.fold-panel summary span,
.fold-panel summary small {
  display: block;
}

.fold-panel summary span {
  font-size: 20px;
  font-weight: 900;
}

.fold-panel summary small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.fold-content {
  padding: 0 20px 20px;
}

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

.quick-card,
.phase-card,
.project-card,
.manual-card,
.ask-card,
.faq-item,
.term,
.link-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.quick-card {
  min-height: 120px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  transition: transform .18s ease, border-color .18s ease;
}

.quick-card:hover {
  border-color: var(--black);
}

.quick-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.quick-card p,
.quick-card small {
  display: block;
  margin: 0;
  line-height: 1.55;
}

.quick-card p {
  color: var(--muted);
}

.quick-card small {
  margin-top: 9px;
  color: var(--green);
  font-weight: 900;
}

.phase-grid,
.project-grid,
.manual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.phase-card,
.project-card,
.manual-card,
.ask-card,
.term,
.link-item {
  padding: 15px;
}

.phase-card {
  display: grid;
  gap: 10px;
}

.phase-card .phase-label {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.phase-card p,
.project-card p,
.ask-card p,
.term p,
.link-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.phase-card ul,
.project-card ul,
.ask-card ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  padding: 0;
}

.faq-item summary {
  min-height: 54px;
  padding: 14px;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p,
.faq-item small {
  display: block;
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  line-height: 1.65;
}

.faq-item small {
  color: var(--green);
  font-weight: 900;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filter {
  background: #ffffff;
  color: var(--ink);
}

.filter.active {
  background: var(--black);
  color: #ffffff;
}

.project-card {
  display: grid;
  gap: 13px;
}

.project-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.project-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.warning {
  padding: 10px;
  border-radius: 7px;
  background: var(--amber-soft);
  color: #654000;
  font-size: 13px;
  line-height: 1.5;
}

.mini-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.mini-actions a {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.project-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.project-details summary {
  min-height: auto;
  display: block;
  padding: 10px 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.project-details summary::-webkit-details-marker {
  display: none;
}

.project-details summary::after {
  content: "＋";
  float: right;
}

.project-details[open] summary::after {
  content: "－";
}

.project-details > div {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.project-details strong {
  display: block;
  font-size: 13px;
}

.project-details ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.project-details p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.reward-details {
  background: #fffdf7;
  border-color: #ead7ad;
}

.manual-section-list section {
  display: grid;
  gap: 5px;
}

.manual-card {
  display: grid;
  gap: 9px;
}

.manual-card span {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
}

.manual-card h3 {
  margin: 0;
  font-size: 17px;
}

.manual-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.manual-card a {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

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

.manual-reader {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.manual-reader[hidden],
.manual-index[hidden] {
  display: none;
}

.manual-reader header {
  display: grid;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.manual-reader header span {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.manual-reader h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

.manual-reader a,
.back-link {
  color: var(--blue);
  font-weight: 900;
}

.manual-body {
  display: grid;
  gap: 14px;
  max-width: 820px;
  line-height: 1.85;
}

.manual-body h3 {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 4px solid #fff51f;
  border-radius: 8px;
  background: var(--green-soft);
  color: #3f3f3f;
  font-size: 18px;
}

.manual-body p,
.manual-body ul {
  margin: 0;
  color: var(--ink);
}

.manual-body ul {
  padding-left: 24px;
}

.manual-body .text-red {
  color: var(--red);
  font-weight: 900;
}

.manual-body mark {
  border-radius: 4px;
  background: #fff176;
  color: inherit;
  padding: 0 3px;
}

.manual-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.manual-page-panel summary {
  display: none;
}

.manual-page-content {
  padding: 36px 32px;
}

.manual-page-content #manualCards {
  display: block;
}

.manual-page-panel .manual-reader {
  width: 100%;
  max-width: 980px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.manual-page-panel .manual-reader header {
  padding-bottom: 18px;
}

.manual-page-panel .manual-body {
  max-width: 100%;
}

.review-tool {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 980px;
  margin-top: 26px;
  padding: 20px;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  background: #fffaf0;
}

.review-tool h3 {
  margin: 0;
  color: #2f3033;
  font-size: 22px;
}

.review-tool label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #2f3033;
  font-weight: 900;
}

.review-tool input,
.review-tool select,
.review-tool textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.review-tool textarea {
  line-height: 1.65;
  resize: vertical;
}

.review-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr);
  gap: 12px;
}

.review-tool-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.review-tool-actions button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #fff51f;
  color: #202124;
  font-weight: 900;
  cursor: pointer;
}

.review-tool-actions span {
  color: var(--muted);
  font-size: 13px;
}

.review-result {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  line-height: 1.7;
}

.review-result > strong {
  font-size: 18px;
}

.review-result p {
  margin: 0;
}

.review-issues {
  display: grid;
  gap: 10px;
}

.review-issues article {
  display: grid;
  gap: 4px;
  border-left: 4px solid #fff51f;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff7d6;
}

.review-issues span {
  color: #3f3f3f;
  font-size: 12px;
  font-weight: 900;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 18px;
}

.checklist,
.ask-list,
.glossary,
.link-list {
  display: grid;
  gap: 9px;
}

.check-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.check-row strong {
  display: block;
  margin-bottom: 4px;
}

.check-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.summary-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbf8;
}

.meter {
  display: flex;
  align-items: center;
  gap: 18px;
}

.meter svg {
  width: 106px;
  height: 106px;
  transform: rotate(-90deg);
}

.meter circle {
  fill: none;
  stroke-width: 10;
}

.meter circle:first-child {
  stroke: #e0e6df;
}

#progressCircle {
  stroke: var(--green);
  stroke-linecap: round;
  stroke-dasharray: 302;
  stroke-dashoffset: 302;
  transition: stroke-dashoffset .25s ease;
}

.meter strong {
  display: block;
  font-size: 32px;
}

.meter span,
.summary-panel p {
  color: var(--muted);
}

.ask-card strong {
  display: block;
  margin-bottom: 8px;
}

.ask-card em {
  display: block;
  padding: 10px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-style: normal;
  font-weight: 900;
  line-height: 1.5;
}

.message-builder {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfb;
}

.message-builder h3 {
  margin: 7px 0 16px;
  font-size: 18px;
}

.message-builder select,
.message-builder textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.message-builder textarea {
  resize: vertical;
  margin-bottom: 12px;
}

.wide {
  width: 100%;
}

.message-output {
  min-height: 96px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #111713;
  color: #ffffff;
  white-space: pre-wrap;
  line-height: 1.6;
}

.term {
  display: grid;
  gap: 5px;
  border-left: 4px solid var(--green);
}

.term b {
  color: var(--red);
}

.term span {
  font-weight: 900;
}

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

.link-item a {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 900;
}

.admin-page {
  background:
    linear-gradient(90deg, rgba(36, 95, 202, .045) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(180deg, #ffffff 0%, #f4f7fb 58%, #eef3ef 100%);
}

.admin-shell {
  max-width: 1320px;
}

.admin-hero {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.admin-public-link {
  color: var(--green);
  font-weight: 900;
}

.admin-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-page.admin-section-page .admin-status {
  display: none;
}

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

.admin-page.admin-section-page .admin-grid article {
  display: none;
}

.admin-page.admin-section-page .admin-grid article.active-page {
  display: block;
}

.admin-card,
.admin-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 14px 36px rgba(24, 33, 29, .06);
}

.admin-card {
  padding: 16px;
}

.admin-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-card strong {
  display: block;
  margin: 6px 0;
  font-size: 24px;
}

.admin-card p,
.admin-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.admin-grid article {
  padding: 18px;
}

.admin-grid h1 {
  margin: 5px 0 10px;
  font-size: 24px;
  text-align: left;
}

.admin-list,
.admin-actions,
.admin-rules,
.admin-form {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  line-height: 1.55;
}

.admin-row.readonly {
  display: block;
}

.admin-row button,
.admin-actions button,
.admin-form button {
  min-height: 38px;
  border: 1px solid var(--black);
  border-radius: 7px;
  background: var(--black);
  color: #ffffff;
  padding: 0 12px;
  font-weight: 900;
}

.admin-row button:disabled,
.admin-actions button:disabled,
.admin-form button:disabled {
  border-color: var(--line-strong);
  background: #e7ece9;
  color: var(--muted);
  cursor: not-allowed;
}

.admin-row-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.admin-row small {
  color: var(--muted);
  font-weight: 900;
}

.admin-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-form label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-form input,
.admin-form textarea,
.link-edit-row input,
.manual-edit-row input,
.manual-edit-row textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px;
  background: #ffffff;
}

.admin-form textarea {
  resize: vertical;
}

.link-edit-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
}

.manual-edit-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.manual-edit-row label {
  display: grid;
  gap: 6px;
}

.manual-edit-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.manual-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.manual-toolbar button:hover {
  background: var(--green-soft);
  color: #3f3f3f;
}

.manual-edit-row .manual-toolbar button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.manual-edit-row .manual-toolbar button:hover {
  background: var(--green-soft);
  color: #3f3f3f;
}

.manual-toolbar button:focus,
.manual-toolbar button:active {
  background: #ffffff;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
}

.manual-toolbar button:focus-visible {
  outline: 2px solid rgba(26, 115, 232, .3);
  outline-offset: 2px;
}

.manual-edit-row textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.7;
}

.review-rule-edit-row textarea {
  min-height: 160px;
}

.review-rule-header {
  display: grid;
  gap: 3px;
}

.review-rule-header span,
.review-rule-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.review-rule-header strong {
  font-size: 18px;
}

.review-rule-help {
  margin: -2px 0 0;
  line-height: 1.6;
}

.manual-edit-row button {
  justify-self: start;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fff51f;
  color: #202124;
  padding: 0 12px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.admin-rules {
  margin-bottom: 0;
  padding-left: 18px;
  line-height: 1.8;
}

.admin-toast {
  min-height: 24px;
  margin-top: 12px;
  color: var(--green);
  font-weight: 900;
}

@media (max-width: 920px) {
  .app-layout {
    width: 100%;
    max-width: 100%;
    padding: 70px 18px 40px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .site-sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    width: min(86vw, 330px);
    height: 100svh;
    max-height: none;
    border-radius: 0 8px 8px 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  body.menu-open .site-sidebar {
    transform: translateX(0);
  }

  .mobile-menu-button {
    position: fixed;
    z-index: 40;
    top: 14px;
    left: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--black);
    border-radius: 8px;
    background: #ffffff;
    color: var(--black);
    font-size: 22px;
    font-weight: 900;
    box-shadow: var(--shadow);
  }

  .mobile-menu-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: none;
    background: rgba(16, 21, 18, .34);
  }

  body.menu-open .mobile-menu-backdrop {
    display: block;
  }

  .home-search {
    padding: 20px;
  }

  .home-start {
    grid-template-columns: 1fr;
  }

  .start-card {
    min-height: 0;
  }

  .tool-strip,
  .phase-grid,
  .project-grid,
  .manual-index,
  .split-section,
  .admin-status,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  h1 {
    max-width: 100%;
    font-size: 27px;
    line-height: 1.24;
  }

  .home-search {
    gap: 18px;
    align-content: start;
    padding: 18px;
  }

  .home-tools {
    max-width: none;
  }

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

  .search-row button {
    display: none;
  }

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

  .chat-input-row button {
    width: 100%;
  }

  .search-row input,
  .chat-input-row input {
    min-height: 42px;
    font-size: 16px;
  }

  .home-links {
    width: 100%;
    max-width: 240px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .home-links button {
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
  }

  .home-security {
    max-width: 320px;
    line-height: 1.6;
  }

  .fold-panel summary {
    padding: 16px;
  }

  .fold-content {
    padding: 0 14px 14px;
  }

  .project-card header,
  .link-item,
  .admin-hero,
  .admin-row {
    display: grid;
  }

  .review-tool-grid {
    grid-template-columns: 1fr;
  }

  .bubble {
    max-width: 100%;
  }
}

/* Material-style visual refresh */
.site-sidebar,
.home-search,
.fold-panel,
.quick-card,
.phase-card,
.project-card,
.manual-card,
.ask-card,
.faq-item,
.term,
.link-item,
.summary-panel,
.message-builder,
.admin-hero,
.admin-card,
.admin-grid article,
.admin-row,
.check-row {
  border-color: var(--line);
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow);
}

.site-sidebar {
  background: rgba(255, 255, 255, .99);
}

.brand-mark {
  background: linear-gradient(135deg, #fff51f 0%, #ffe082 100%);
  color: #202124;
  box-shadow: 0 1px 2px rgba(60, 64, 67, .18);
}

.sitemap-nav p,
.eyebrow,
.phase-card .phase-label {
  color: var(--blue);
}

.sitemap-nav a {
  border-radius: 8px;
  transition: background .16s ease, color .16s ease;
}

.sitemap-nav a:hover,
.sitemap-nav a:focus-visible {
  background: var(--green-soft);
  color: #3f3f3f;
}

.admin-sidebar .sitemap-nav a:hover,
.admin-sidebar .sitemap-nav a:focus-visible {
  background: var(--blue-soft);
  color: var(--blue);
}

.search-row,
.chat-input-row {
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px transparent, var(--shadow);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-row:focus-within,
.chat-input-row:focus-within {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue), var(--shadow-strong);
}

.search-row button,
.chat-input-row button,
.primary-button,
.filter,
.admin-row button,
.admin-actions button,
.admin-form button {
  border-color: transparent;
  background: #fff51f;
  color: #202124;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.search-row button {
  border-color: var(--line);
  background: #ffffff;
}

.chat-input-row button:hover,
.primary-button:hover,
.filter:hover,
.search-row button:hover,
.quick-card:hover,
.home-links button:hover,
.admin-row button:hover,
.admin-actions button:hover,
.admin-form button:hover {
  box-shadow: var(--shadow-strong);
}

.filter {
  border-color: var(--line);
  background: #ffffff;
}

.filter.active {
  background: #fff51f;
  color: #202124;
}

.home-links button {
  border: 0;
  border-radius: 999px;
  background: var(--green-soft);
  color: #3f3f3f;
  padding: 8px 13px;
}

.status-dot {
  background: #fff51f;
  box-shadow: 0 0 0 5px rgba(255, 245, 31, .2);
}

.fold-panel summary::after {
  background: var(--green-soft);
  color: #3f3f3f;
}

.quick-card:hover {
  border-color: #fff51f;
}

.quick-card small,
.faq-item small,
.mini-actions a,
.project-details summary,
.manual-card a,
.link-item a,
.admin-public-link,
.admin-toast {
  color: var(--blue);
}

.warning,
.summary-panel,
.reward-details {
  background: var(--surface);
  border-color: #e3e3e3;
  color: #3f3f3f;
}

.project-details {
  background: #f8fafd;
}

.manual-card span,
.result-item span,
.tag {
  background: var(--blue-soft);
  color: var(--blue);
}

.term {
  border-left-color: #fff51f;
}

.check-row input {
  accent-color: #fff51f;
}

#progressCircle {
  stroke: #fff51f;
}

.bubble.assistant {
  box-shadow: var(--shadow);
}

.bubble.user {
  background: #fff51f;
  color: #202124;
  box-shadow: var(--shadow);
}

.message-output {
  background: #202124;
}

.message-builder select:focus,
.message-builder textarea:focus,
.admin-form input:focus,
.admin-form textarea:focus,
.link-edit-row input:focus,
.search-row input:focus,
.chat-input-row input:focus {
  outline: 2px solid rgba(26, 115, 232, .22);
  border-color: var(--blue);
}

.admin-page {
  background:
    linear-gradient(rgba(255, 245, 31, .14) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255, 245, 31, .14) 1px, transparent 1px) 0 0 / 28px 28px,
    #fffef8;
}

.admin-row button:disabled,
.admin-actions button:disabled,
.admin-form button:disabled {
  border-color: var(--line);
  background: #f1f3f4;
  color: var(--muted);
  box-shadow: none;
}

.mobile-menu-button {
  border-color: var(--line);
  background: #ffffff;
  color: #202124;
  box-shadow: var(--shadow-strong);
}

/* Sidebar as a full-height navigation rail */
.app-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 24px 52px 0;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.app-main {
  padding-top: 22px;
}

.site-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  max-height: 100svh;
  border: 0;
  border-right: 1px solid #d7d7d7;
  border-radius: 0;
  background: #fff7d6;
  box-shadow: 2px 0 10px rgba(60, 64, 67, .08);
}

.sidebar-brand {
  border-bottom-color: rgba(47, 48, 51, .2);
}

.sitemap-nav {
  gap: 20px;
}

.sitemap-nav section {
  gap: 4px;
}

.sitemap-nav p {
  margin: 0 0 8px;
  color: #3f3f3f;
  font-size: 13px;
}

.sitemap-subnav {
  display: grid;
  gap: 4px;
}

.sitemap-inline-heading {
  display: block;
  margin: 12px 0 4px;
  padding: 0 12px;
  color: #3f3f3f;
  font-size: 13px;
  font-weight: 900;
}

.sitemap-nav a {
  border-radius: 999px;
  padding: 9px 12px;
  background: transparent;
  color: #2f3033;
  font-size: 15px;
  font-weight: 900;
  box-shadow: none;
}

.sitemap-nav a:hover,
.sitemap-nav a:focus-visible {
  background: rgba(255, 255, 255, .72);
  color: #3f3f3f;
}

.sitemap-subnav a {
  padding-left: 12px;
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 920px) {
  .app-layout {
    width: 100%;
    max-width: 100%;
    padding: 70px 18px 40px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .app-main {
    padding-top: 0;
  }

  .site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 330px);
    height: 100svh;
    max-height: none;
    border-right: 1px solid #d7d7d7;
    border-radius: 0 8px 8px 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }
}

/* Minimal editorial theme */
:root {
  --paper: #eeeeee;
  --panel: #ffffff;
  --surface: #f4f4f4;
  --surface-soft: #f7f7f7;
  --ink: #2f3033;
  --muted: #777b80;
  --line: #e3e3e3;
  --line-strong: #cfcfcf;
  --green: #fff51f;
  --green-soft: #fff982;
  --blue: #2f3033;
  --blue-soft: #f3f3f3;
  --amber: #2f3033;
  --amber-soft: #f4f4f4;
  --red: #d93025;
  --red-soft: #f8e8e6;
  --black: #202124;
  --shadow: none;
  --shadow-strong: none;
}

body,
.admin-page {
  background: var(--paper);
  color: var(--ink);
}

.app-layout {
  width: 100%;
  max-width: none;
  min-height: 100svh;
  margin: 0;
  padding: 0 18px 18px 0;
  grid-template-columns: 278px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.app-main {
  gap: 0;
  padding-top: 0;
}

.site-sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  max-height: 100svh;
  padding: 18px 12px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
}

.sidebar-brand {
  margin-bottom: 20px;
  padding: 0 10px 18px;
  border-bottom: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

.brand strong {
  color: var(--ink);
  font-size: 18px;
  letter-spacing: .01em;
}

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

.sitemap-nav {
  gap: 18px;
  margin-top: 0;
}

.sitemap-nav section {
  gap: 2px;
}

.sitemap-nav p,
.sitemap-inline-heading {
  margin: 16px 0 6px;
  padding: 0 14px;
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 700;
}

.sitemap-nav a,
.sitemap-subnav a {
  min-height: 36px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  padding: 8px 14px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.sitemap-nav a:hover,
.sitemap-nav a:focus-visible {
  background: #e5e5e5;
  color: var(--ink);
}

.sitemap-nav a.is-current,
.sitemap-nav a[aria-current="page"] {
  background: var(--green);
  color: #232323;
}

.sitemap-nav .home-nav-link {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.home-nav-link span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.page-breadcrumb {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-breadcrumb a {
  color: var(--ink);
  text-decoration: none;
}

.page-breadcrumb span[aria-hidden="true"] {
  color: #b6b6b6;
}

#breadcrumbCurrent {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex-wrap: wrap;
}

.home-search,
.fold-panel,
.admin-hero,
.admin-status,
.admin-grid article {
  border: 0;
  border-radius: 10px 10px 0 0;
  background: #ffffff;
  box-shadow: none;
}

.home-search {
  min-height: calc(100svh - 80px);
  align-content: start;
  gap: 28px;
  padding: clamp(34px, 5vw, 72px) clamp(24px, 8vw, 112px);
}

.compact-brand {
  display: none;
}

.home-copy {
  max-width: 760px;
}

.eyebrow,
.sitemap-nav p,
.phase-card .phase-label {
  color: var(--muted);
}

h1 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: 0;
}

.home-copy p:not(.eyebrow),
.manual-body p,
.manual-body li {
  color: var(--ink);
  font-size: 16px;
  line-height: 2;
}

.home-start {
  max-width: 920px;
  gap: 12px;
}

.start-card,
.quick-card,
.phase-card,
.project-card,
.manual-card,
.ask-card,
.faq-item,
.term,
.link-item,
.summary-panel,
.message-builder,
.admin-card,
.admin-row,
.check-row,
.review-tool,
.review-result,
.result-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.start-card.primary,
.start-card:hover,
.start-card:focus-visible,
.quick-card:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  transform: none;
  box-shadow: none;
}

.start-card span {
  background: var(--ink);
  color: #ffffff;
}

.start-card p,
.quick-card p,
.quick-card small,
.phase-card p,
.faq-item small,
.result-item p,
.result-item small {
  color: var(--muted);
}

.home-tools {
  max-width: 920px;
}

.search-row,
.chat-input-row,
.review-tool input,
.review-tool select,
.review-tool textarea,
.message-builder select,
.message-builder textarea,
.admin-form input,
.admin-form textarea,
.link-edit-row input,
.manual-edit-row input,
.manual-edit-row textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.search-row:focus-within,
.chat-input-row:focus-within {
  border-color: var(--line-strong);
  box-shadow: none;
}

.search-row button,
.chat-input-row button,
.primary-button,
.filter,
.admin-row button,
.admin-actions button,
.admin-form button,
.manual-edit-row button,
.review-tool-actions button {
  border-color: transparent;
  border-radius: 7px;
  background: var(--green);
  color: #202124;
  box-shadow: none;
}

.search-row button {
  border-color: var(--line);
  background: #ffffff;
}

.chat-input-row button:hover,
.primary-button:hover,
.filter:hover,
.search-row button:hover,
.home-links button:hover,
.admin-row button:hover,
.admin-actions button:hover,
.admin-form button:hover,
.review-tool-actions button:hover {
  transform: none;
  box-shadow: none;
}

.home-links button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
}

.public-page.section-page .home-search {
  display: none;
}

.public-page.section-page .fold-stack {
  padding-top: 0;
}

.fold-stack {
  padding-top: 0;
}

.fold-panel {
  min-height: calc(100svh - 80px);
  overflow: visible;
}

.fold-panel > summary {
  display: none;
}

.faq-item summary {
  min-height: 54px;
  display: block;
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.faq-item p,
.faq-item small {
  padding: 0 18px 16px;
}

.fold-content,
.manual-page-content {
  padding: clamp(34px, 5vw, 72px) clamp(24px, 9vw, 128px);
}

.manual-page-panel .manual-reader,
.manual-reader {
  max-width: 850px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.manual-reader header {
  padding: 0 0 34px;
  border-bottom: 0;
}

.manual-reader h2 {
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.25;
  text-align: left;
}

.manual-body {
  max-width: 850px;
  gap: 22px;
  color: var(--ink);
}

.manual-body h3 {
  margin: 56px 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.35;
}

.manual-body ul {
  padding-left: 1.3em;
}

.manual-body a,
.back-link {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.manual-body .manual-link-card {
  margin: 26px 0 34px;
}

.manual-body .manual-link-card a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  max-width: 720px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 6px 6px 0 #fff51f;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.manual-body .manual-link-card a:hover,
.manual-body .manual-link-card a:focus-visible {
  background: #f8f8f8;
  box-shadow: 3px 3px 0 #fff51f;
  transform: translate(3px, 3px);
  outline: none;
}

.manual-body .manual-link-card span {
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 900;
  line-height: 1.45;
}

.manual-body .manual-link-card b {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.manual-body mark {
  border-radius: 0;
  background: var(--green);
  color: inherit;
  padding: 0 .12em;
  font-weight: 800;
}

.manual-callout {
  margin: 26px 0;
  padding: 30px clamp(22px, 4vw, 42px);
  border-radius: 8px;
  border: 1px solid #f0e6a8;
  background: #fff9d8;
  color: var(--ink);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.85;
  text-align: left;
}

.warning,
.summary-panel,
.reward-details,
.project-details {
  background: #f6f6f6;
  border-color: var(--line);
  color: var(--ink);
}

.manual-card span,
.result-item span,
.tag {
  background: #f2f2f2;
  color: var(--ink);
}

.term {
  border-left-color: var(--line);
}

.check-row input {
  accent-color: var(--green);
}

#progressCircle {
  stroke: var(--ink);
}

.bubble.user {
  background: var(--green);
  color: var(--ink);
  box-shadow: none;
}

.bubble.assistant {
  box-shadow: none;
}

.review-tool h3 {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.admin-shell {
  padding-right: 18px;
}

.admin-page .site-sidebar,
.admin-page .page-breadcrumb {
  background: var(--paper);
}

.mobile-menu-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
}

@media (max-width: 920px) {
  .app-layout {
    padding: 64px 12px 18px;
    grid-template-columns: 1fr;
  }

  .app-main {
    padding-top: 0;
  }

  .site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: min(86vw, 330px);
    height: 100svh;
    max-height: none;
    background: var(--paper);
    border-right: 1px solid var(--line);
    border-radius: 0 10px 10px 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  body.menu-open .site-sidebar {
    transform: translateX(0);
  }

  .page-breadcrumb {
    display: none;
  }

  .home-search,
  .fold-panel {
    min-height: calc(100svh - 82px);
  }

  .home-start {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  h1,
  .manual-reader h2 {
    font-size: 34px;
  }

  .home-search,
  .fold-content,
  .manual-page-content {
    padding: 28px 18px;
  }

  .manual-body h3 {
    font-size: 25px;
  }
}

.public-page .site-sidebar {
  padding-top: 62px;
}

.public-page .sitemap-nav section:first-child p {
  margin-top: 0;
}

.ai-chat-content {
  padding: 0;
}

.ai-chat-page {
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr) auto;
  min-height: calc(100svh - 80px);
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) clamp(24px, 7vw, 92px);
}

.ai-chat-header {
  display: grid;
  gap: 12px;
  padding-bottom: 26px;
}

.ai-chat-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.25;
}

.ai-chat-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.ai-chat-log {
  align-content: start;
  display: grid;
  gap: 14px;
  min-height: 360px;
  overflow-y: auto;
  padding: 8px 0 28px;
}

.chat-message {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.chat-message.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--green);
}

.ai-chat-log .bubble {
  max-width: min(760px, 100%);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
  color: var(--ink);
  line-height: 1.85;
  white-space: pre-line;
}

.ai-chat-log .bubble.user {
  justify-self: end;
  border-color: transparent;
  background: var(--green);
}

.ai-chat-log .bubble.assistant {
  justify-self: start;
  background: #f7f7f7;
}

.chat-references {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  white-space: normal;
}

.chat-references span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chat-references a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.chat-references a:hover,
.chat-references a:focus-visible {
  border-color: var(--line-strong);
  background: var(--green);
  outline: none;
}

.faq-list {
  gap: 30px;
}

.faq-filter {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 0 22px;
  background: #ffffff;
}

.faq-filter button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  background: #f5f5f5;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.faq-filter button:hover,
.faq-filter button:focus-visible {
  border-color: var(--line-strong);
  background: #eeeeee;
  outline: none;
}

.faq-filter button.is-active {
  border-color: transparent;
  background: var(--green);
}

.faq-sections {
  display: grid;
  gap: 44px;
}

.faq-category {
  display: grid;
  gap: 18px;
}

.faq-category h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.35;
}

.faq-category-list {
  display: grid;
  gap: 0;
}

.faq-category .faq-item {
  display: grid;
  gap: 12px;
  padding: 26px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.faq-category .faq-item.is-filtered-out {
  display: none;
}

.faq-filter-status {
  margin: -16px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.faq-line {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
}

.faq-line span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.faq-line.answer span {
  background: #eeeeee;
  color: var(--ink);
  font-size: 14px;
}

.faq-line h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
}

.faq-line p {
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.faq-line p a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  text-decoration-color: var(--yellow);
}

.faq-category .faq-item small {
  padding: 0 0 0 50px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ai-chat-form {
  position: sticky;
  bottom: 16px;
  padding-top: 12px;
  background: #ffffff;
}

.ai-chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.ai-chat-input-row:focus-within {
  border-color: var(--line-strong);
}

.ai-chat-input-row textarea {
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  border: 0;
  outline: 0;
  resize: none;
  padding: 9px 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
}

.ai-chat-input-row button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
}

@media (max-width: 920px) {
  .public-page .site-sidebar {
    padding-top: 64px;
  }
}

@media (max-width: 560px) {
  .ai-chat-page {
    min-height: calc(100svh - 82px);
    padding: 28px 18px;
  }

  .ai-chat-input-row {
    grid-template-columns: 1fr;
  }
}

/* Final heading scale */
h1,
.manual-reader header h2,
.ai-chat-header h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.3;
}

.home-copy p:not(.eyebrow) {
  font-size: 15px;
}

.manual-body h2 {
  width: 100%;
  margin: 44px 0 14px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--ink);
  font-size: clamp(21px, 2.3vw, 28px);
  line-height: 1.45;
}

.manual-body h3 {
  margin: 34px 0 10px;
  padding: 2px 0 2px 13px;
  border: 0;
  border-left: 6px solid var(--green);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.5;
}

.faq-category h3 {
  font-size: clamp(21px, 2.4vw, 30px);
}

@media (max-width: 560px) {
  h1,
  .manual-reader header h2,
  .ai-chat-header h2 {
    font-size: 30px;
  }

  .manual-body h2 {
    font-size: 22px;
  }

  .manual-body h3,
  .faq-category h3 {
    font-size: 20px;
  }
}

.portal-home {
  gap: 42px;
}

.portal-hero {
  display: grid;
  justify-items: start;
  gap: 12px;
  max-width: 840px;
}

.portal-hero-logo {
  width: clamp(116px, 17vw, 190px);
  height: clamp(116px, 17vw, 190px);
  border-radius: 999px;
  object-fit: cover;
  border: 8px solid #f5f5f5;
  background: var(--green);
}

.portal-hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

.portal-hero h1 span {
  display: inline-block;
  padding: 0;
  background: transparent;
}

.portal-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.portal-sitemap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 34px;
  max-width: 980px;
}

.portal-sitemap section {
  display: grid;
  align-content: start;
  gap: 8px;
}

.portal-sitemap h2 {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 6px;
  background: #f5f5f5;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
}

.portal-sitemap a {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 5px solid var(--green);
  color: var(--ink);
  text-decoration: none;
}

.portal-sitemap a:hover,
.portal-sitemap a:focus-visible {
  background: #f8f8f8;
  outline: none;
}

.portal-sitemap strong {
  font-size: 16px;
  line-height: 1.5;
}

.portal-sitemap small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.search-reader header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.search-reader .search-band {
  max-width: 760px;
}

@media (max-width: 760px) {
  .portal-sitemap {
    grid-template-columns: 1fr;
  }
}

/* Final admin layout: keep every editing surface in one readable column. */
.admin-page .app-main {
  width: 100%;
  max-width: 980px;
}

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

.admin-grid {
  gap: 18px;
}

.admin-grid article,
.admin-card,
.manual-edit-row {
  box-shadow: none;
}

.admin-grid article {
  padding: 24px;
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(120px, .4fr) minmax(120px, .6fr) 1fr;
  align-items: center;
  gap: 12px;
}

.admin-card strong {
  margin: 0;
  font-size: 20px;
}

.admin-card p {
  text-align: left;
}

.link-edit-row,
.admin-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.admin-row-actions {
  justify-content: flex-start;
}

.admin-preview-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 900;
}

.admin-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.admin-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 0;
  margin: 0;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202124;
  color: #ffffff;
  font-weight: 900;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(32, 33, 36, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}

.admin-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.admin-filter-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f8f8;
}

.admin-filter-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-filter-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 12px;
  background: #ffffff;
}

.admin-faq-filter {
  margin-bottom: 0;
}

.admin-import-export {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.admin-import-export strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.admin-import-export small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.6;
}

.admin-direct-faq-form {
  margin-top: 18px;
}

.admin-direct-faq-form > strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.admin-new-manual-form {
  border-color: var(--yellow);
  background: #fffdf0;
}

.admin-checkbox-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
}

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

.admin-preview-link.is-muted {
  color: var(--muted);
  text-decoration: none;
}

.floating-toc {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: grid;
  justify-items: end;
  gap: 10px;
}

.floating-toc[hidden] {
  display: none;
}

.floating-toc-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  width: 64px;
  height: 64px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 5px 5px 0 #d8d8d8;
}

.floating-toc-button b {
  display: block;
  font-size: 24px;
  line-height: .8;
}

.floating-toc-button span {
  display: block;
  font-size: 12px;
  line-height: 1;
}

.floating-toc-panel {
  display: none;
  width: min(320px, calc(100vw - 48px));
  max-height: min(58vh, 520px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(32, 33, 36, .14);
}

.floating-toc.is-open .floating-toc-panel {
  display: block;
}

.floating-toc-panel strong {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.floating-toc-panel ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.floating-toc-panel li.is-child {
  padding-left: 14px;
}

.floating-toc-panel a {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.floating-toc-panel a:hover,
.floating-toc-panel a:focus-visible {
  background: var(--green-soft);
  outline: none;
}

@media (min-width: 1180px) {
  .floating-toc {
    right: 32px;
    bottom: 32px;
  }
}

@media (max-width: 760px) {
  .floating-toc {
    right: 14px;
    bottom: 14px;
  }

  .floating-toc-button {
    width: 56px;
    height: 56px;
  }

  .floating-toc-panel {
    width: calc(100vw - 28px);
    max-height: 62vh;
  }
}

@media (max-width: 760px) {
  .admin-card {
    grid-template-columns: 1fr;
  }

  .admin-grid article {
    padding: 18px;
  }

  .admin-toast {
    right: 12px;
    bottom: 12px;
  }
}

.public-page .sitemap-nav p,
.public-page .sitemap-inline-heading {
  color: #a8adb3;
}

.review-self-check-reader .review-tool {
  max-width: 100%;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.portal-login-screen[hidden],
[data-portal-app][hidden] {
  display: none !important;
}

.portal-login-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.portal-login-card {
  width: min(100%, 440px);
  display: grid;
  gap: 14px;
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 7px solid var(--green);
  border-radius: 10px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--shadow-strong);
}

.portal-login-card h1 {
  font-size: 32px;
}

.portal-login-card > p:not(.eyebrow),
.portal-login-card > small {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.portal-login-brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
}

.portal-login-brand span {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .06em;
}

.portal-login-form {
  display: grid;
  gap: 8px;
}

.portal-login-form label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 900;
}

.portal-login-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
}

.portal-login-form input:focus {
  border-color: var(--ink);
  outline: 3px solid rgba(255, 245, 31, .28);
}

.portal-login-form button,
.portal-viewer-bar button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--green);
  color: var(--ink);
  font-weight: 900;
}

.portal-login-form button {
  margin-top: 8px;
}

.portal-login-form button:disabled {
  cursor: wait;
  opacity: .55;
}

.portal-login-error {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid #f0b8b3;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.portal-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.portal-viewer-bar span {
  min-width: 0;
  display: grid;
  justify-items: end;
}

.portal-viewer-bar strong {
  overflow: hidden;
  max-width: 340px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-viewer-bar small {
  color: var(--muted);
  font-weight: 900;
}

.portal-viewer-bar button {
  min-height: 36px;
  padding: 7px 12px;
  background: #ffffff;
}

.auth-required .mobile-menu-button,
.auth-required .mobile-menu-backdrop {
  display: none;
}

#accounts-panel {
  grid-column: 1 / -1;
}

.account-create-form {
  margin-top: 18px;
}

.password-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-field-row button {
  min-width: 72px;
}

.credential-output {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d0a900;
  border-radius: 8px;
  background: #fff9d8;
}

.credential-output[hidden] {
  display: none;
}

.credential-output p {
  margin: 0;
}

.credential-output code {
  user-select: all;
  color: var(--ink);
  font-weight: 900;
}

.credential-output small {
  color: var(--muted);
  line-height: 1.6;
}

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

.account-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.account-card header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.account-card header strong {
  overflow-wrap: anywhere;
}

.account-card label {
  display: grid;
  gap: 6px;
}

.account-card label > span,
.account-card .account-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-card input:not([type="checkbox"]),
.account-card select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
}

.account-card > button {
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 900;
}

.legacy-account-card {
  border-style: dashed;
  background: #f8fafd;
}

.legacy-account-card p,
.legacy-account-card small,
.account-meta {
  margin: 0;
}

.legacy-account-card small {
  color: var(--muted);
  line-height: 1.6;
}

.account-role {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.account-role.trial {
  background: var(--green-soft);
  color: var(--ink);
}

.account-role.contract {
  background: var(--blue-soft);
  color: var(--blue);
}

@media (max-width: 760px) {
  .portal-login-card {
    padding: 24px 20px;
  }

  .portal-viewer-bar {
    justify-content: space-between;
  }

  .portal-viewer-bar span {
    justify-items: start;
  }

  .account-list {
    grid-template-columns: 1fr;
  }
}
