:root {
  color-scheme: light;
  font-family:
    Inter, "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --background: #ffffff;
  --sidebar: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
  --surface-hover: #eff1f4;
  --text: #202123;
  --muted: #6b6f76;
  --subtle: #959aa3;
  --border: #e3e5e8;
  --accent: #5865d8;
  --accent-dark: #424db9;
  --accent-soft: #eef0ff;
  --official: #176b52;
  --official-soft: #e9f7f1;
  --shadow: 0 16px 50px rgb(26 29 36 / 9%);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--background);
}

button,
textarea,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

.sidebar {
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 14px;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid #eeeeef;
  scrollbar-gutter: stable;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 42px;
  padding: 0 8px;
}

.brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  background: #20232b;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
}

.brand-mark span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 1px;
  background: #fff;
  transform-origin: center;
}

.brand-mark span:first-child {
  transform: translate(-50%, -50%) rotate(0deg);
}

.brand-mark span:nth-child(2) {
  transform: translate(-50%, -50%) rotate(60deg);
}

.brand-mark span:last-child {
  transform: translate(-50%, -50%) rotate(-60deg);
}

.new-search {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 23px 0 28px;
  padding: 10px 11px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.new-search:hover {
  background: var(--surface);
  border-color: #d2d5da;
}

.sidebar-link {
  display: block;
  margin: -16px 0 25px;
  padding: 9px 11px;
  color: #454951;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sidebar-link:hover {
  background: var(--surface-hover);
  border-color: #d2d5da;
}

.new-search svg,
.icon-button svg,
.submit-button svg,
.profile-dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.filter-group {
  margin-bottom: 25px;
}

.filter-label {
  margin: 0 8px 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.filter-option {
  position: relative;
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  color: #44474d;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
}

.filter-option:hover {
  background: var(--surface-hover);
}

.filter-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.filter-option small {
  margin-left: auto;
  color: var(--subtle);
  font-size: 10px;
}

.filter-option.disabled {
  cursor: default;
  opacity: 0.55;
}

.profile-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-panel-heading .filter-label {
  margin-bottom: 0;
}

.profile-status {
  margin-right: 8px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
}

.profile-active {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  color: #4b5058;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-active strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-active span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.profile-form {
  display: grid;
  gap: 9px;
}

.profile-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-tab {
  min-width: 0;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.profile-tab.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(15 23 42 / 8%);
}

.profile-tab-panel {
  display: grid;
  gap: 9px;
}

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

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

.profile-field-row-three {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}

.profile-field {
  display: grid;
  gap: 5px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.profile-field input,
.profile-field select {
  min-width: 0;
  width: 100%;
  height: 31px;
  padding: 0 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: 0;
}

.profile-field input:focus,
.profile-field select:focus {
  border-color: #b9beee;
  box-shadow: 0 0 0 3px rgb(88 101 216 / 10%);
}

.profile-field input[readonly] {
  color: var(--subtle);
  background: #f4f5f8;
}

.profile-field-note {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
}

.teshis-core-section {
  display: grid;
  gap: 9px;
}

.equipment-slot-section {
  display: grid;
  gap: 9px;
}

.equipment-slot-heading {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.equipment-slot-heading h3 {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.equipment-slot-heading span {
  color: var(--subtle);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.equipment-slot-grid {
  display: grid;
  gap: 8px;
}

.equipment-slot-row {
  display: grid;
  grid-template-columns:
    minmax(72px, 0.7fr)
    minmax(94px, 0.95fr)
    minmax(150px, 1.4fr)
    minmax(170px, 1.25fr);
  gap: 7px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.equipment-slot-row strong {
  align-self: center;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.equipment-derived {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 82%, white);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.teshis-core-section h3 {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.teshis-core-grid {
  display: grid;
  gap: 9px;
}

.teshis-core-region {
  display: grid;
  grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  gap: 8px;
  align-items: end;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.teshis-core-region:first-child {
  padding-top: 0;
  border-top: 0;
}

.teshis-core-region strong {
  align-self: center;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.profile-submit {
  height: 32px;
  padding: 0 11px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.profile-submit:hover {
  background: var(--accent-dark);
}

.profile-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.profile-secondary {
  height: 32px;
  padding: 0 11px;
  color: #454951;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.profile-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: #d2d5da;
}

.profile-secondary:disabled {
  cursor: default;
  opacity: 0.48;
}

.profile-message {
  min-height: 15px;
  margin: 0 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.profile-dialog {
  width: min(520px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #d8dade;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(26 29 36 / 18%);
}

.profile-dialog::backdrop {
  background: rgb(18 20 26 / 32%);
}

.profile-dialog .profile-form {
  display: block;
}

.profile-dialog-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 14px;
}

.profile-dialog-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.profile-dialog-close {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.profile-dialog-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.profile-dialog-body {
  display: grid;
  gap: 11px;
  max-height: calc(100vh - 190px);
  padding: 0 18px 18px;
  overflow-y: auto;
}

.profile-dialog-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 18px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

.profile-dialog-footer .profile-submit,
.profile-dialog-footer .profile-secondary {
  min-width: 104px;
}

.sidebar-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding: 10px 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #42a77d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(66 167 125 / 12%);
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.mobile-header {
  display: none;
}

.content {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.welcome,
.conversation {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
}

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 190px);
  padding: 13vh 0 60px;
  text-align: center;
}

.atlas-orbit {
  position: relative;
  width: 68px;
  height: 68px;
  margin-bottom: 26px;
}

.orbit {
  position: absolute;
  inset: 6px;
  border: 1px solid #aeb4f0;
  border-radius: 50%;
}

.orbit-one {
  transform: rotate(24deg) scaleY(0.45);
}

.orbit-two {
  transform: rotate(-48deg) scaleY(0.45);
}

.orbit-core {
  position: absolute;
  inset: 25px;
  background: var(--accent);
  border: 5px solid var(--accent-soft);
  border-radius: 50%;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.welcome h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.welcome-copy {
  max-width: 610px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 30px;
}

.suggestions button {
  padding: 9px 13px;
  color: #555a62;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, color 150ms ease;
}

.suggestions button:hover {
  color: var(--accent-dark);
  border-color: #b8bdee;
  transform: translateY(-1px);
}

.conversation {
  padding: 58px 0 70px;
}

.query-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.query-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  background: #22252c;
  border-radius: 8px;
}

.message-label {
  margin: 1px 0 7px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.query-row h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.result-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 31px 0 18px;
}

.result-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.text-button {
  flex: none;
  padding: 4px 0;
  color: var(--accent-dark);
  font-size: 12px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.answer-card {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.answer-text {
  margin: 0;
  color: #2f3338;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-line;
}

.sources-header {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
}

.sources-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.sources-header p {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
}

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

.result-card {
  padding: 19px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.result-card:hover {
  border-color: #cfd2da;
  box-shadow: 0 8px 30px rgb(32 33 35 / 7%);
  transform: translateY(-1px);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.badge {
  padding: 4px 7px;
  color: var(--official);
  font-size: 10px;
  font-weight: 700;
  background: var(--official-soft);
  border-radius: 5px;
}

.meta-text {
  color: var(--subtle);
  font-size: 11px;
}

.result-title {
  display: inline;
  color: #25272c;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.55;
  text-decoration: none;
}

.result-title:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-snippet {
  display: -webkit-box;
  margin: 11px 0 0;
  overflow: hidden;
  color: #5d6168;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-line;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.source-heading {
  margin: 6px 0 0;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.6;
}

.result-footer {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: 13px;
  color: var(--subtle);
  font-size: 11px;
}

.result-footer svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.empty-state {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-soft);
  border-radius: 16px;
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 17px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.composer-wrap {
  z-index: 10;
  padding: 16px 28px 13px;
  background: linear-gradient(to bottom, rgb(255 255 255 / 0%), #fff 24px);
}

.composer {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 13px 14px 10px;
  background: var(--surface);
  border: 1px solid #d8dade;
  border-radius: 17px;
  box-shadow: var(--shadow);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within {
  border-color: #b9beee;
  box-shadow: 0 16px 55px rgb(58 64 130 / 13%);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 150px;
  padding: 2px 3px 8px;
  overflow-y: auto;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  resize: none;
  background: transparent;
  border: 0;
  outline: 0;
}

.composer textarea::placeholder {
  color: #9a9da4;
}

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

.active-filters {
  overflow: hidden;
  color: var(--subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submit-button {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.submit-button:hover {
  background: var(--accent-dark);
}

.submit-button:active {
  transform: scale(0.96);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.disclaimer {
  margin: 8px auto 0;
  color: #a1a4aa;
  font-size: 10px;
  text-align: center;
}

.sidebar-backdrop {
  display: none;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, 85vw);
    box-shadow: 20px 0 45px rgb(20 22 28 / 18%);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgb(18 20 26 / 30%);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-backdrop.open {
    visibility: visible;
    opacity: 1;
  }

  .workspace {
    grid-template-rows: auto 1fr auto;
  }

  .mobile-header {
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    align-items: center;
    height: 52px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 650;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }

  .icon-button {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    background: transparent;
    border: 0;
    border-radius: 8px;
  }

  .welcome,
  .conversation {
    width: min(100% - 30px, 760px);
  }

  .welcome {
    min-height: calc(100vh - 230px);
    padding-top: 9vh;
  }

  .welcome-copy {
    font-size: 13px;
  }

  .conversation {
    padding-top: 32px;
  }

  .result-header {
    display: block;
  }

  .text-button {
    margin-top: 8px;
  }

  .composer-wrap {
    padding: 12px 10px 8px;
  }

  .profile-dialog {
    max-height: calc(100vh - 24px);
  }

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

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

  .equipment-slot-heading {
    display: grid;
  }

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

  .profile-dialog .teshis-core-region {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-page {
    width: min(100% - 30px, 920px);
    padding-top: 18px;
  }

  .content-page-summary {
    align-items: start;
  }

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

  .content-candidate-card-header {
    display: block;
  }

  .content-candidate-card-header a {
    display: inline-block;
    margin-top: 6px;
  }
}

.ai-answer-section {
  margin-bottom: 32px;
}

.ai-answer-label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.ai-badge {
  padding: 3px 8px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--accent-soft);
  border-radius: 5px;
}

.ai-answer-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.9;
}

.ai-answer-body p,
.ai-answer-body ul,
.ai-answer-body h3,
.ai-answer-body h4,
.ai-answer-body h5 {
  margin: 0 0 14px;
}

.ai-answer-body p:last-child,
.ai-answer-body ul:last-child {
  margin-bottom: 0;
}

.ai-answer-body ul {
  padding-left: 1.45em;
}

.ai-answer-body li {
  padding-left: 0.2em;
  margin-bottom: 4px;
}

.ai-answer-body h3,
.ai-answer-body h4,
.ai-answer-body h5 {
  font-weight: 700;
  line-height: 1.5;
}

.ai-answer-body h3 {
  font-size: 18px;
}

.ai-answer-body h4,
.ai-answer-body h5 {
  font-size: 16px;
}

.ai-answer-body strong {
  font-weight: 750;
}

.ai-answer-body code {
  padding: 2px 5px;
  font-size: 0.9em;
  background: var(--surface-soft);
  border-radius: 5px;
}

.ai-answer-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ai-fallback-notice {
  padding: 14px 18px;
  margin-bottom: 20px;
  color: #7a5400;
  font-size: 13px;
  background: #fff8e6;
  border: 1px solid #fde08d;
  border-radius: 10px;
}

.citation-header {
  margin: 26px 0 12px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.citation-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 150ms ease, transform 150ms ease;
}

.citation-card:hover {
  border-color: #cfd2da;
  transform: translateY(-1px);
}

.citation-number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-soft);
  border-radius: 6px;
}

.citation-title {
  display: block;
  color: #25272c;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.5;
}

.citation-title:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.citation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.thinking-dots span {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: thinking-pulse 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.sidebar-mode {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sidebar-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.sidebar-mode-dot.ai { background: var(--accent); box-shadow: 0 0 0 3px rgb(88 101 216 / 12%); }
.sidebar-mode-dot.search { background: #42a77d; box-shadow: 0 0 0 3px rgb(66 167 125 / 12%); }

.content-page {
  width: min(920px, calc(100% - 48px));
  height: 100vh;
  margin: 0 auto;
  padding: 28px 0 64px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.content-page-header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 34px;
}

.content-page-brand {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.content-page-back {
  display: inline-grid;
  min-width: 94px;
  place-items: center;
  text-decoration: none;
}

.content-page-summary {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.content-page-summary h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.profile-page-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  margin: 18px 0 26px;
}

.profile-page-panel,
.profile-page-form-panel,
.content-candidates-panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.profile-page-panel-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-page-panel-heading h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.profile-page-active {
  margin-bottom: 13px;
}

.profile-page-form {
  gap: 14px;
}

.profile-page-form-actions {
  display: flex;
  justify-content: flex-end;
}

.content-profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin: 18px 0 26px;
  padding: 13px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.content-profile-strip strong {
  font-size: 13px;
}

.content-profile-strip span {
  color: var(--muted);
  font-size: 12px;
}

.content-candidates-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.content-candidates-heading h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.content-candidates-heading > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.content-candidate-list {
  display: grid;
  gap: 24px;
}

.content-location-section {
  display: grid;
  gap: 10px;
}

.content-location-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.content-location-heading h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.content-location-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.content-location-list {
  display: grid;
  gap: 10px;
}

.content-candidate-card {
  padding: 16px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.content-candidate-card-header {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.content-candidate-card-header h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.content-candidate-card-header a {
  flex: none;
  color: var(--accent-dark);
  font-size: 12px;
  text-decoration: none;
}

.content-candidate-card-header a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.content-requirements span {
  padding: 4px 7px;
  color: #474b53;
  font-size: 11px;
  font-weight: 650;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

@media (max-width: 760px) {
  .content-page {
    width: min(100% - 30px, 920px);
    padding-top: 18px;
  }

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

  .content-page-summary,
  .content-candidates-heading,
  .profile-page-panel-heading {
    align-items: start;
  }

  .profile-page-form .profile-field-row {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .content-candidate-card-header {
    display: block;
  }

  .content-candidate-card-header a {
    display: inline-block;
    margin-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .thinking-dots span { animation: none; opacity: 0.6; }
}
