/* app/styles.css */
:root {
  --bg: #f7f9fc;
  --bg-soft: #f8fafc;
  --panel: #fff;
  --panel-soft: #f4f6fb;
  --text: #111827;
  --text-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --ai: #5a55ee;
  --ai-dark: #3430b8;
  --ai-soft: #f3f2ff;
  --trust: #0f766e;
  --trust-soft: #ecfdf5;
  --ok: #15803d;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow-soft: 0 14px 40px #0f172a14;
  --shadow-card: 0 8px 24px #0f172a0f;
  --shadow-hover: 0 18px 42px #0f172a1a;
  --shadow-focus: 0 0 0 4px #5a55ee1f;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --font-display: "Wanted Sans", "Pretendard Variable", "Noto Sans KR", sans-serif;
  --font-body: "Pretendard Variable", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  min-width: 320px;
}

body {
  color: var(--text);
  letter-spacing: 0;
  background-color: #0000;
  background-image: radial-gradient(circle at 18% 0%, #eff6ffe6, #0000 30%), radial-gradient(circle at 88% 8%, #f3f2ffcc, #0000 32%), linear-gradient(#fffffff5, #f7f9fcfc), url("https://www.inha.ac.kr/sites/kr/images/sub/visual_sub01.jpg");
  background-position: top;
  background-repeat: repeat, repeat, repeat, repeat;
  background-size: cover;
  background-attachment: fixed;
  background-origin: padding-box, padding-box, padding-box, padding-box;
  background-clip: border-box, border-box, border-box, border-box;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: wait;
  opacity: .68;
}

a {
  color: inherit;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.32rem;
  line-height: 1.18;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.22;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.35;
}

input, textarea, select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  outline: none;
  width: 100%;
}

input, select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 108px;
  padding: 12px;
  line-height: 1.65;
}

:focus-visible {
  outline: 2px solid #0000;
  box-shadow: var(--shadow-focus);
}

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

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

.error-text {
  border-radius: var(--radius-md);
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 14px 16px;
  font-weight: 800;
}

.app-shell {
  width: min(1180px, 100vw - 28px);
  margin: 0 auto;
  padding: 10px 0 36px;
}

.topbar {
  z-index: 20;
  display: grid;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  backdrop-filter: blur(18px);
  background: #ffffffe0;
  border: 1px solid #e2e8f0db;
  gap: 14px;
  margin: 0 -8px;
  padding: 10px 8px 12px;
  box-shadow: 0 10px 28px #0f172a0d;
}

.brand-lockup {
  display: flex;
  align-items:  center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  background: linear-gradient(135deg, var(--brand), var(--ai));
  color: #fff;
  border-radius: 13px;
  flex: none;
  place-items:  center;
  width: 40px;
  height: 40px;
  font-weight: 900;
  box-shadow: 0 12px 28px #2563eb3d;
}

.topbar-title {
  min-width: 0;
}

.brand-subtitle {
  color: var(--muted);
  word-break: keep-all;
  margin: 4px 0 0;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.35;
}

.current-view-label {
  display: inline-flex;
  color: var(--text-soft);
  justify-self: start;
  align-items:  center;
  gap: 8px;
  min-height: 36px;
  margin: 0;
  font-weight: 850;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #f8fafce6;
  gap: 4px;
  width: 100%;
  padding: 4px;
}

.segment, .primary-button, .composer-submit, .feedback-row button, .sample-row button, .related-row button, .admin-item button, .admin-lock-button {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text-soft);
  text-decoration: none;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  transition: transform .14s, border-color .14s, background-color .14s, color .14s, box-shadow .14s;
  font-weight: 800;
}

.segment {
  color: var(--muted);
  background: none;
  border: 0;
  min-height: 44px;
}

.segment:not(.active) {
  color: var(--text-soft);
}

.segment:hover, .sample-row button:hover, .related-row button:hover, .feedback-row button:hover, .admin-item button:hover, .admin-lock-button:hover {
  color: var(--ai-dark);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

.segment.active, .primary-button, .composer-submit {
  border-color: var(--ai);
  background: linear-gradient(135deg, var(--brand), var(--ai));
  color: #fff;
  box-shadow: 0 12px 30px #5a55ee3d;
}

.chat-experience {
  display: grid;
  gap: 10px;
  width: min(920px, 100%);
  margin: 12px auto 0;
}

.chat-experience.has-answer {
  gap: 12px;
  width: min(1040px, 100%);
  margin-top: 10px;
}

.chat-hero {
  display: grid;
  text-align: center;
  justify-items: center;
  padding: 18px 0 2px;
}

.has-answer .chat-hero {
  padding: 12px 0 0;
}

.hero-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(760px, 100%);
}

.has-answer .hero-copy {
  gap: 6px;
}

.hero-kicker {
  border-radius: var(--radius-pill);
  background: var(--ai-soft);
  color: var(--ai-dark);
  border: 1px solid #dedeff;
  margin: 0;
  padding: 7px 12px;
  font-size: .78rem;
  font-weight: 900;
}

.chat-hero h2 {
  text-wrap: balance;
  word-break: keep-all;
  max-width: 680px;
  margin: 0;
  font-size: clamp(2rem, 12vw, 2.55rem);
  line-height: 1.18;
}

.has-answer .chat-hero h2 {
  font-size: clamp(1.48rem, 7vw, 1.92rem);
}

.chat-hero p:last-child {
  color: var(--muted);
  word-break: keep-all;
  max-width: 620px;
  margin: 0;
  line-height: 1.65;
}

.has-answer .hero-kicker {
  padding: 5px 10px;
  font-size: .72rem;
}

.has-answer .chat-hero p:last-child {
  font-size: .9rem;
  line-height: 1.5;
}

.search-composer {
  display: grid;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  background: #fffffff5;
  border: 1px solid #dfe3ee;
  gap: 10px;
  padding: 12px;
  transition: border-color .15s, border-width .15s, box-shadow .15s;
}

.search-composer:focus-within {
  box-shadow: var(--shadow-soft), var(--shadow-focus);
  border-width: 1.5px;
  border-color: #4f4bcc;
}

.composer-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items:  start;
  gap: 10px;
  min-width: 0;
}

.composer-field svg {
  color: var(--ai);
  margin-top: 12px;
}

.composer-field textarea {
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  color: var(--text);
  border: 0;
  min-height: 118px;
  padding: 14px 12px;
  font-size: 1rem;
}

.has-answer .composer-field textarea {
  min-height: 78px;
}

.composer-field textarea:focus {
  box-shadow: none;
}

.composer-submit {
  width: 100%;
  min-height: 48px;
}

.has-answer .composer-submit {
  min-height: 46px;
}

.sample-panel {
  display: grid;
  gap: 0;
}

.sample-row {
  display: flex;
  overflow-x: auto;
  scroll-padding-inline: 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #0000 0, #000 14px calc(100% - 36px), #0000 100%);
  border: 0;
  gap: 8px;
  min-inline-size: 0;
  margin: 0 -14px;
  padding: 0 14px 5px;
}

.sample-row::-webkit-scrollbar {
  display: none;
}

.sample-row button {
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  white-space: nowrap;
  word-break: keep-all;
  background: #fffffff0;
  flex: none;
}

.answer-hint {
  display: flex;
  color: var(--muted);
  text-align: center;
  word-break: keep-all;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1.5;
}

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

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

.empty-answer-card, .loading-card, .answer-card, .source-section, .related-panel, .feedback-panel, .no-source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  background: #fffffff5;
  min-width: 0;
  max-width: 100%;
}

.empty-answer-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
}

.empty-answer-icon {
  display: grid;
  background: var(--ai-soft);
  color: var(--ai);
  border-radius: 14px;
  place-items:  center;
  width: 42px;
  height: 42px;
}

.empty-answer-card h3 {
  margin-bottom: 4px;
}

.empty-answer-card p {
  margin-bottom: 0;
  line-height: 1.6;
}

.loading-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.loading-card strong {
  color: var(--text-soft);
  font-size: .95rem;
}

.skeleton-line {
  display: block;
  border-radius: var(--radius-pill);
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #eef2f7 0%, #fff 48%, #eef2f7 100%) 0 0 / 220% 100%;
  width: 78%;
  height: 16px;
}

.skeleton-line.wide {
  width: 96%;
}

.skeleton-line.short {
  width: 42%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.answer-card {
  display: grid;
  background: linear-gradient(#fffffffa, #f8fafffa), linear-gradient(90deg, #5a55ee14, #0000 36%);
  border-left: 4px solid #818cf8;
  gap: 16px;
  padding: 18px;
}

.answer-card.needs-check {
  border-left-color: #a5b4fc;
}

.answer-card-header, .trust-row, .section-heading, .feedback-row, .related-row {
  display: flex;
  align-items:  center;
}

.answer-card-header {
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.answer-card-header > div {
  min-width: 0;
}

.answer-badge {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--ai-soft);
  color: var(--ai-dark);
  align-items:  center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  font-size: .86rem;
  font-weight: 900;
}

.answer-freshness {
  color: var(--muted);
  margin: 8px 0 0;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.45;
}

.answer-text {
  display: grid;
  overflow-wrap: anywhere;
  border-radius: var(--radius-lg);
  color: var(--text-soft);
  font-family: var(--font-body);
  word-break: keep-all;
  background: #f8fafc94;
  border: 1px solid #e2e8f0b8;
  gap: 10px;
  margin: 0;
  padding: 14px;
  font-size: 1rem;
  line-height: 1.72;
}

.answer-text p {
  margin: 0;
}

.answer-caution {
  align-items:  flex-start;
}

.answer-action-row {
  display: flex;
  min-inline-size: 0;
  border: 0;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.answer-action-row button, .answer-action-row a {
  display: inline-flex;
  border-radius: var(--radius-pill);
  color: var(--ai-dark);
  text-decoration: none;
  background: #fff;
  border: 1px solid #c7d2fe;
  flex: 140px;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  transition: border-color .14s, background-color .14s, color .14s, transform .14s;
  font-weight: 900;
}

.answer-action-row button:hover, .answer-action-row a:hover {
  border-color: var(--ai);
  background: var(--ai-soft);
  transform: translateY(-1px);
}

.answer-action-row span {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--ai-soft);
  color: var(--ai-dark);
  justify-content: center;
  align-items:  center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 8px;
  font-size: .78rem;
  line-height: 1;
}

.answer-feedback {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.answer-feedback > p {
  color: var(--muted);
  margin: 0;
  font-size: .82rem;
  font-weight: 900;
}

.answer-section {
  display: grid;
  border-radius: var(--radius-sm);
  background: #ffffffbd;
  border: 1px solid #e2e8f0e6;
  gap: 7px;
  min-width: 0;
  padding: 12px;
}

.answer-section h4 {
  display: flex;
  color: var(--brand-dark);
  align-items:  center;
  gap: 8px;
  margin: 0;
  font-size: .86rem;
  font-weight: 900;
  line-height: 1.35;
}

.answer-section h4:before {
  display: block;
  border-radius: var(--radius-pill);
  background: var(--ai);
  content: "";
  width: 7px;
  height: 7px;
}

.answer-section.caution h4 {
  color: #9a3412;
}

.answer-section.caution h4:before {
  background: var(--warn);
}

.answer-section p {
  color: var(--text-soft);
  margin: 0;
  line-height: 1.72;
}

.answer-section.freshness p, .answer-section.sources p {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 800;
}

.warning-strip {
  display: flex;
  border-radius: var(--radius-sm);
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  flex-wrap: wrap;
  align-items:  center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  font-weight: 900;
  line-height: 1.45;
}

.badge {
  display: inline-flex;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  align-items:  center;
  gap: 6px;
  width: max-content;
  min-height: 30px;
  padding: 0 10px;
  font-size: .8rem;
  font-weight: 900;
}

.badge.ok {
  background: var(--trust-soft);
  color: var(--trust);
}

.badge.warn {
  color: var(--warn);
  background: #fff7ed;
}

.badge.bad {
  color: var(--bad);
  background: #fef2f2;
}

.badge.neutral, .badge.freshness.neutral {
  color: var(--text-soft);
  background: #eef2f7;
}

.badge.trust.ok {
  background: var(--trust-soft);
  color: var(--trust);
  border: 1px solid #bbf7d0;
}

.badge.trust.warn.medium, .badge.trust.warn.low, .badge.trust.warn.unknown {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.badge.freshness.neutral.active, .badge.freshness.neutral.upcoming, .badge.freshness.neutral.evergreen {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px solid #bfdbfe;
}

.badge.freshness.warn.archived, .badge.freshness.warn.recently_expired {
  color: var(--warn);
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

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

.source-section, .related-panel, .feedback-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.section-heading {
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 0;
}

.section-heading h3, .section-title h2 {
  margin: 0;
}

.section-heading span {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  align-items:  center;
  min-height: 28px;
  padding: 0 10px;
  font-size: .82rem;
  font-weight: 900;
}

.source-grid {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.source-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  gap: 12px;
  min-width: 0;
  padding: 15px;
  transition: border-color .14s, box-shadow .14s, transform .14s;
}

.source-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #c7d2fe;
  transform: translateY(-1px);
}

.source-card h3 {
  overflow-wrap: anywhere;
  margin: 0;
}

.source-title-row {
  display: flex;
  justify-content: space-between;
  align-items:  flex-start;
  gap: 10px;
}

.source-name {
  color: var(--muted);
  margin: 0 0 5px;
  font-size: .78rem;
  font-weight: 900;
}

.source-status, .source-meta-pill {
  display: inline-flex;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  align-items:  center;
  width: max-content;
  min-height: 24px;
  padding: 0 8px;
  font-size: .72rem;
  font-weight: 900;
}

.source-status.active, .source-status.upcoming, .source-status.evergreen {
  background: var(--trust-soft);
  color: var(--trust);
}

.source-status.recently_expired {
  color: var(--warn);
  background: #fff7ed;
}

.source-status.archived {
  color: var(--bad);
  background: #fef2f2;
}

.source-meta-pill {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.source-meta-pill.source-state.active, .source-meta-pill.source-state.upcoming, .source-meta-pill.source-state.evergreen {
  background: var(--trust-soft);
  color: var(--trust);
}

.source-meta-pill.source-state.recently_expired {
  color: var(--warn);
  background: #fff7ed;
}

.source-meta-pill.source-state.archived {
  color: var(--bad);
  background: #fef2f2;
}

.source-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.source-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.source-meta dt {
  color: var(--muted);
  font-size: .78rem;
}

.source-meta dd {
  color: var(--text-soft);
  overflow-wrap: anywhere;
  text-align: right;
  min-width: 0;
  margin: 0;
  font-weight: 800;
}

.source-link {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  text-decoration: none;
  border: 1px solid #bfdbfe;
  justify-content: center;
  align-items:  center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  transition: border-color .14s, background-color .14s, transform .14s;
  font-weight: 900;
}

.source-link:hover {
  border-color: var(--brand);
  background: #dbeafe;
  transform: translateY(-1px);
}

.no-source-card {
  color: var(--muted);
  margin: 0;
  padding: 14px;
  line-height: 1.6;
}

.related-row, .feedback-row {
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.related-row button {
  overflow: hidden;
  background: var(--ai-soft);
  color: var(--ai-dark);
  text-align: left;
  word-break: keep-all;
  flex: 100%;
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding-block-start: 9px;
  padding-block-end: 9px;
}

.related-row button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.feedback-row button {
  flex: 100%;
  min-width: 0;
  min-height: 44px;
}

.feedback-row button.selected {
  border-color: var(--ai);
  background: var(--ai-soft);
  color: var(--ai-dark);
}

.feedback-row span {
  display: inline-flex;
  color: var(--trust);
  align-items:  center;
  min-height: 32px;
  font-size: .84rem;
  font-weight: 900;
}

.details-dialog-backdrop {
  position: fixed;
  z-index: 80;
  display: flex;
  backdrop-filter: blur(8px);
  background: #0f172a61;
  justify-content: center;
  align-items:  flex-end;
  padding: 14px 10px 0;
  inset: 0;
}

.details-dialog {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 24px 24px 0 0;
  width: min(100%, 720px);
  min-width: 0;
  max-height: min(86vh, 760px);
  box-shadow: 0 -18px 50px #0f172a2e;
}

.details-dialog-head {
  display: flex;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  align-items:  flex-start;
  gap: 12px;
  min-width: 0;
  padding: 18px 18px 12px;
}

.details-dialog-head h3 {
  color: var(--text);
  margin: 2px 0 5px;
  font-size: 1.1rem;
}

.details-dialog-head p:last-child {
  color: var(--muted);
  word-break: keep-all;
  margin: 0;
  line-height: 1.5;
}

.dialog-kicker {
  color: var(--ai);
  margin: 0;
  font-size: .76rem;
  font-weight: 900;
}

.dialog-close {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: #fff;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 44px;
  height: 44px;
}

.dialog-close:hover {
  background: var(--ai-soft);
  color: var(--ai-dark);
  border-color: #c7d2fe;
}

.details-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  gap: 8px;
  padding: 12px 18px;
}

.details-tabs button {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  background: #fff;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  min-height: 44px;
  font-weight: 900;
}

.details-tabs button.active {
  border-color: var(--ai);
  background: var(--ai);
  color: #fff;
}

.details-tabs span {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: #ffffff38;
  justify-content: center;
  align-items:  center;
  min-width: 22px;
  min-height: 22px;
  padding: 0 7px;
  font-size: .76rem;
}

.details-tabs button:not(.active) span {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.details-dialog-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 16px 18px 20px;
}

.dialog-source-grid, .evidence-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

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

.evidence-summary span {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--brand-dark);
  align-items:  center;
  min-height: 30px;
  padding: 0 10px;
  font-size: .8rem;
  font-weight: 900;
}

.evidence-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  background: #fff;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

.evidence-card > p:first-child {
  color: var(--muted);
  margin: 0;
  font-size: .78rem;
  font-weight: 900;
}

.evidence-card h4 {
  color: var(--text);
  overflow-wrap: anywhere;
  margin: 0;
}

.evidence-card > span {
  color: var(--brand-dark);
  font-size: .8rem;
  font-weight: 900;
}

.evidence-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  word-break: keep-all;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin: 0;
  line-height: 1.65;
}

.related-panel.compact {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: none;
  background: #f8fafc;
  min-inline-size: 0;
  margin: 0;
  padding: 14px;
}

.admin-login {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  gap: 14px;
  width: min(430px, 100%);
  margin: 42px auto 0;
  padding: 22px;
}

.admin-login-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items:  start;
  gap: 12px;
  margin-bottom: 4px;
}

.admin-login-head h2 {
  margin: 0 0 6px;
}

.admin-login-head p:last-child {
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.admin-login label {
  color: var(--text-soft);
  font-weight: 900;
}

.admin-dashboard {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.admin-page-head {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: #fffffff0;
  gap: 12px;
  padding: 18px;
}

.admin-page-head h2 {
  margin: 0 0 6px;
}

.admin-page-head p:last-child {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.admin-lock-button {
  width: 100%;
}

.admin-grid {
  display: grid;
  align-items:  start;
  gap: 12px;
}

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

.metric, .admin-list {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.metric {
  border-top: 4px solid var(--brand);
  min-width: 0;
  min-height: 96px;
  padding: 14px;
}

.metric-blue {
  border-top-color: var(--brand);
}

.metric-green {
  border-top-color: var(--ok);
}

.metric-orange {
  border-top-color: var(--warn);
}

.metric-slate {
  border-top-color: #64748b;
}

.metric-teal {
  border-top-color: var(--trust);
}

.metric-violet {
  border-top-color: var(--ai);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  color: var(--text);
  margin-top: 6px;
  font-size: clamp(1.5rem, 8vw, 1.95rem);
  line-height: 1;
}

.admin-list {
  display: grid;
  overflow: hidden;
  gap: 12px;
  min-width: 0;
  padding: 16px;
}

.section-title {
  display: flex;
  align-items:  flex-start;
  gap: 10px;
  margin-bottom: 0;
}

.section-icon {
  display: grid;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 10px;
  flex: none;
  place-items:  center;
  width: 34px;
  height: 34px;
}

.section-title p {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: .82rem;
  line-height: 1.5;
}

.admin-stat-row, .runtime-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.admin-stat-row span, .runtime-row span {
  display: inline-flex;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  color: var(--text-soft);
  overflow-wrap: anywhere;
  align-items:  center;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
  font-size: .78rem;
  font-weight: 850;
}

.runtime-row span {
  white-space: normal;
}

.admin-status-matrix {
  display: grid;
  gap: 10px;
}

.admin-status-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.admin-status-card h3 {
  color: var(--text);
  margin: 0;
  font-size: .92rem;
}

.admin-item {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfdff;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  transition: border-color .14s, box-shadow .14s;
}

.admin-item:hover {
  box-shadow: var(--shadow-card);
  border-color: #bfdbfe;
}

.admin-item h3, .admin-item p {
  margin-bottom: 0;
}

.admin-item h3, .admin-item p {
  overflow-wrap: break-word;
  word-break: normal;
}

.admin-item button {
  border-radius: var(--radius-sm);
  width: max-content;
}

.admin-item-meta {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1.55;
}

.admin-filter-row {
  display: grid;
  gap: 10px;
}

.admin-filter-row label {
  display: grid;
  color: var(--text-soft);
  gap: 6px;
  font-size: .78rem;
  font-weight: 900;
}

.chunk-preview {
  border: 1px solid #ccfbf1;
  border-left: 4px solid var(--trust);
  border-radius: var(--radius-sm);
  background: var(--trust-soft);
  color: var(--text-soft);
  overflow-wrap: anywhere;
  margin: 0;
  padding: 12px;
  line-height: 1.6;
}

.chunk-preview strong {
  display: block;
  color: var(--trust);
  margin-bottom: 4px;
}

.admin-review-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-card);
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

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

.admin-table th {
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 900;
}

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

.admin-table tbody tr:hover {
  background: #f8fbff;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table td {
  color: var(--text-soft);
  font-size: .86rem;
  line-height: 1.5;
}

.admin-table td[data-label="상태"] {
  white-space: nowrap;
}

.admin-table td > strong, .admin-table td > span {
  display: block;
  overflow-wrap: anywhere;
  max-width: 340px;
}

.admin-table td > strong {
  color: var(--text);
}

.admin-grid > .warning-strip {
  grid-column: 1 / -1;
}

.admin-v2-shell {
  color: #0f172a;
  background: radial-gradient(circle at 88% 2%, #4f4bcc14, #0000 28%), linear-gradient(#fff 0, #f8fafc 46% 100%);
  min-height: 100vh;
}

.admin-v2-topbar {
  position: sticky;
  z-index: 30;
  display: flex;
  backdrop-filter: blur(14px);
  background: #fffffff0;
  border-bottom: 1px solid #e2e8f0;
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 18px;
  top: 0;
}

.admin-v2-brand, .admin-v2-topbar-actions, .admin-v2-nav button, .admin-v2-refresh, .admin-v2-logout, .admin-v2-badge, .admin-v2-table-link, .admin-v2-copy-id, .admin-v2-external-link, .admin-v2-primary-action, .admin-v2-danger-action {
  display: inline-flex;
  align-items:  center;
}

.admin-v2-brand {
  gap: 12px;
  min-width: 0;
}

.admin-v2-brand h1 {
  color: #0f172a;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 950;
}

.admin-v2-mark {
  display: grid;
  color: #fff;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #4f4bcc, #2563eb);
  border-radius: 8px;
  place-items:  center;
  width: 30px;
  height: 30px;
  font-size: .78rem;
  font-weight: 950;
}

.admin-v2-env {
  display: inline-flex;
  color: #4f4bcc;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  align-items:  center;
  min-height: 24px;
  margin-top: 4px;
  padding: 0 9px;
  font-size: .75rem;
  font-weight: 900;
}

.admin-v2-topbar-actions {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.admin-v2-updated {
  color: #64748b;
  white-space: nowrap;
  font-size: .86rem;
  font-weight: 800;
}

.admin-v2-refresh, .admin-v2-logout, .admin-v2-filter-actions button, .admin-v2-panel-head button, .admin-v2-table-footer button, .admin-v2-data-tabs button {
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  font-size: .84rem;
  font-weight: 900;
}

.admin-v2-refresh:hover, .admin-v2-logout:hover, .admin-v2-filter-actions button:hover, .admin-v2-panel-head button:hover, .admin-v2-table-footer button:hover, .admin-v2-data-tabs button:hover {
  color: #4f4bcc;
  border-color: #4f4bcc;
}

.admin-v2-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.admin-v2-sidebar {
  position: sticky;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #ffffffd1;
  border-right: 1px solid #e2e8f0;
  height: calc(100vh - 68px);
  padding: 22px 14px;
  top: 68px;
}

.admin-v2-nav {
  display: grid;
  align-content:  start;
  gap: 8px;
}

.admin-v2-nav button {
  color: #334155;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 10px;
  justify-content: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  font-size: .9rem;
  font-weight: 850;
}

.admin-v2-nav button:hover {
  color: #4f4bcc;
  background: #f1f5ff;
}

.admin-v2-nav button.active {
  color: #4f4bcc;
  background: #eef2ff;
  box-shadow: inset 3px 0 #4f4bcc;
}

.admin-v2-operator {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  align-items:  center;
  gap: 10px;
  padding: 11px;
}

.admin-v2-operator > span {
  display: grid;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  place-items:  center;
  width: 36px;
  height: 36px;
  font-weight: 950;
}

.admin-v2-operator strong {
  display: block;
  font-size: .84rem;
}

.admin-v2-operator p {
  color: #64748b;
  margin: 2px 0 0;
  font-size: .76rem;
}

.admin-v2-main {
  min-width: 0;
  padding: 28px 30px 34px;
}

.admin-v2-mobile-nav {
  display: none;
}

.admin-v2-loading {
  background: #f8fafc;
  min-height: 100vh;
  margin: 0;
  padding: 40px;
}

.admin-v2-note {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #4f4bcc;
  border-radius: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  font-weight: 850;
}

.admin-v2-view {
  display: grid;
  gap: 16px;
  width: min(100%, 1440px);
  margin: 0 auto;
}

.admin-v2-section-head {
  display: flex;
  align-items:  end;
  gap: 14px;
  min-width: 0;
}

.admin-v2-section-head p {
  color: #4f4bcc;
  text-transform: uppercase;
  margin: 0;
  font-size: .76rem;
  font-weight: 950;
}

.admin-v2-section-head h2 {
  color: #0f172a;
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 950;
}

.admin-v2-section-head span {
  color: #64748b;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.45;
}

.admin-v2-action-grid, .admin-v2-metric-grid, .admin-v2-overview-grid, .admin-v2-two-column, .admin-v2-three-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.admin-v2-metric-grid-wide {
  grid-template-columns: repeat(7, minmax(140px, 1fr));
}

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

.admin-v2-two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.admin-v2-action-card, .admin-v2-metric, .admin-v2-panel, .admin-v2-table-card, .admin-v2-drawer, .admin-v2-empty-state {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  min-width: 0;
  box-shadow: 0 8px 24px #0f172a0a;
}

.admin-v2-action-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  color: #0f172a;
  text-align: left;
  align-items:  center;
  gap: 4px 14px;
  min-height: 132px;
  padding: 18px;
}

.admin-v2-action-card span:not(.admin-v2-action-icon) {
  color: #334155;
  font-size: .9rem;
  font-weight: 900;
}

.admin-v2-action-card strong {
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}

.admin-v2-action-card small, .admin-v2-action-card em {
  grid-column: 2;
  color: #64748b;
  font-size: .78rem;
  font-style: normal;
  line-height: 1.4;
}

.admin-v2-action-card em {
  display: inline-flex;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  align-items:  center;
  width: max-content;
  min-height: 30px;
  padding: 0 10px;
  font-weight: 900;
}

.admin-v2-action-icon, .admin-v2-metric-icon {
  display: grid;
  border-radius: 12px;
  place-items:  center;
}

.admin-v2-action-icon {
  grid-row: 1 / span 4;
  width: 52px;
  height: 52px;
}

.admin-v2-metric {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  text-align: left;
  align-items:  center;
  gap: 4px 12px;
  min-height: 86px;
  padding: 14px;
}

.admin-v2-metric-button {
  width: 100%;
}

.admin-v2-metric-icon {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
}

.admin-v2-metric-label {
  color: #475569;
  font-size: .78rem;
  font-weight: 900;
}

.admin-v2-metric strong {
  color: #0f172a;
  font-size: clamp(1.35rem, 3vw, 1.72rem);
  line-height: 1;
}

.admin-v2-metric-detail {
  color: #64748b;
  font-size: .75rem;
  font-weight: 850;
}

.tone-primary .admin-v2-action-icon, .tone-primary .admin-v2-metric-icon {
  color: #4f4bcc;
  background: #eef2ff;
}

.tone-success .admin-v2-action-icon, .tone-success .admin-v2-metric-icon {
  color: #16a34a;
  background: #dcfce7;
}

.tone-warning .admin-v2-action-icon, .tone-warning .admin-v2-metric-icon {
  color: #d97706;
  background: #ffedd5;
}

.tone-danger .admin-v2-action-icon, .tone-danger .admin-v2-metric-icon {
  color: #dc2626;
  background: #fee2e2;
}

.tone-neutral .admin-v2-metric-icon {
  color: #64748b;
  background: #f1f5f9;
}

.admin-v2-badge {
  color: #334155;
  white-space: nowrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  min-height: 24px;
  padding: 0 8px;
  font-size: .74rem;
  font-weight: 950;
}

.admin-v2-badge.tone-primary {
  color: #4f4bcc;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.admin-v2-badge.tone-success {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.admin-v2-badge.tone-warning {
  color: #c2410c;
  background: #fff7ed;
  border-color: #fed7aa;
}

.admin-v2-badge.tone-danger {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.admin-v2-panel, .admin-v2-table-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.admin-v2-panel-head, .admin-v2-table-footer {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  min-width: 0;
}

.admin-v2-panel-head h3 {
  color: #0f172a;
  margin: 0;
  font-size: 1rem;
  font-weight: 950;
}

.admin-v2-compact-rows, .admin-v2-detail-grid {
  display: grid;
  gap: 0;
  margin: 0;
}

.admin-v2-compact-rows div, .admin-v2-detail-grid div {
  display: flex;
  border-top: 1px solid #e2e8f0;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 10px 0;
}

.admin-v2-compact-rows div:first-child, .admin-v2-detail-grid div:first-child {
  border-top: 0;
}

.admin-v2-compact-rows dt, .admin-v2-detail-grid dt {
  color: #64748b;
  font-size: .82rem;
  font-weight: 850;
}

.admin-v2-compact-rows dd, .admin-v2-detail-grid dd {
  color: #0f172a;
  overflow-wrap: anywhere;
  text-align: right;
  min-width: 0;
  margin: 0;
  font-weight: 900;
}

.admin-v2-source-health {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items:  center;
  gap: 18px;
}

.admin-v2-donut {
  display: grid;
  background: radial-gradient(circle, #fff 0 52%, transparent 53%), conic-gradient(#16a34a var(--value), #e2e8f0 0);
  text-align: center;
  border-radius: 50%;
  place-items:  center;
  width: 112px;
  height: 112px;
}

.admin-v2-donut strong, .admin-v2-donut span {
  grid-area: 1 / 1;
}

.admin-v2-donut strong {
  transform: translateY(-7px);
}

.admin-v2-donut span {
  color: #64748b;
  font-size: .75rem;
  font-weight: 900;
  transform: translateY(12px);
}

.admin-v2-empty-state {
  display: flex;
  color: #15803d;
  align-items:  center;
  gap: 14px;
  padding: 18px;
}

.admin-v2-empty-state h3, .admin-v2-empty-state p {
  margin: 0;
}

.admin-v2-empty-state p, .admin-v2-muted, .admin-v2-safe-note, .admin-v2-success-note, .admin-v2-empty-inline {
  color: #64748b;
  line-height: 1.55;
}

.admin-v2-success-note {
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin: 0;
  padding: 12px;
  font-weight: 850;
}

.admin-v2-filterbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  gap: 10px;
  padding: 12px;
}

.admin-v2-filterbar label {
  display: grid;
  color: #64748b;
  gap: 6px;
  font-size: .75rem;
  font-weight: 950;
}

.admin-v2-search-filter {
  grid-column: span 2;
}

.admin-v2-search-filter div {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  align-items:  center;
  gap: 8px;
  padding: 0 10px;
}

.admin-v2-search-filter input {
  box-shadow: none;
  background: none;
  border: 0;
  padding: 9px 0;
}

.admin-v2-search-filter input:focus {
  box-shadow: none;
}

.admin-v2-filter-actions {
  display: flex;
  align-items:  end;
  gap: 8px;
}

.admin-v2-feedback-workspace, .admin-v2-split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  align-items:  start;
  gap: 14px;
}

.admin-v2-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

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

.admin-v2-table th {
  color: #64748b;
  text-align: left;
  white-space: nowrap;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 11px 12px;
  font-size: .76rem;
  font-weight: 950;
}

.admin-v2-table td {
  color: #334155;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px;
  font-size: .84rem;
  line-height: 1.45;
}

.admin-v2-table tbody tr:hover, .admin-v2-table tbody tr.selected {
  background: #eef2ff;
}

.admin-v2-table td > span {
  display: block;
  color: #64748b;
  font-size: .76rem;
}

.admin-v2-table-link, .admin-v2-copy-id {
  color: #0f172a;
  text-align: left;
  overflow-wrap: anywhere;
  background: none;
  border: 0;
  max-width: 360px;
  padding: 0;
  font-weight: 900;
}

.admin-v2-copy-id {
  color: #4f4bcc;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
  gap: 6px;
  max-width: none;
  font-size: .78rem;
}

.admin-v2-table-footer {
  color: #64748b;
  font-size: .82rem;
  font-weight: 850;
}

.admin-v2-table-footer > div {
  display: flex;
  gap: 8px;
}

.admin-v2-mobile-cards {
  display: none;
}

.admin-v2-drawer {
  position: sticky;
  display: grid;
  overflow: auto;
  gap: 12px;
  max-height: calc(100vh - 104px);
  padding: 16px;
  top: 84px;
}

.admin-v2-drawer-empty {
  position: static;
  color: #64748b;
}

.admin-v2-drawer-head {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.admin-v2-drawer-head h3 {
  margin: 0 0 5px;
}

.admin-v2-drawer-head span {
  color: #64748b;
  font-size: .76rem;
  font-weight: 850;
}

.admin-v2-drawer-head button {
  display: grid;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  flex: none;
  place-items:  center;
  width: 38px;
  height: 38px;
}

.admin-v2-detail-stack {
  display: grid;
  gap: 12px;
}

.admin-v2-detail-block {
  display: grid;
  gap: 5px;
}

.admin-v2-detail-block span, .admin-v2-review-note span, .admin-v2-editor-grid span {
  color: #64748b;
  font-size: .76rem;
  font-weight: 950;
}

.admin-v2-detail-block p {
  color: #334155;
  overflow-wrap: anywhere;
  margin: 0;
  line-height: 1.6;
}

.admin-v2-detail-block.strong p {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 950;
}

.admin-v2-guide-card {
  display: grid;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  gap: 8px;
  padding: 12px;
}

.admin-v2-guide-card p, .admin-v2-guide-card small {
  color: #334155;
  margin: 0;
  line-height: 1.5;
}

.admin-v2-guide-card small {
  color: #64748b;
  font-weight: 850;
}

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

.admin-v2-editor-grid label, .admin-v2-review-note {
  display: grid;
  gap: 6px;
}

.admin-v2-review-note textarea {
  min-height: 108px;
}

.admin-v2-primary-action, .admin-v2-danger-action, .admin-v2-external-link {
  text-decoration: none;
  border-radius: 8px;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  font-weight: 950;
}

.admin-v2-primary-action {
  color: #fff;
  background: #4f4bcc;
  border: 1px solid #4f4bcc;
}

.admin-v2-danger-action {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.admin-v2-external-link {
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.admin-v2-tech-details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
}

.admin-v2-tech-details summary {
  color: #334155;
  cursor: pointer;
  font-weight: 950;
}

.admin-v2-tech-details .admin-v2-detail-block {
  margin-top: 10px;
}

.admin-v2-safety-banner {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(300px, .9fr);
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  align-items:  center;
  gap: 18px;
  padding: 18px;
}

.admin-v2-safety-banner.warn {
  color: #c2410c;
  background: #fff7ed;
  border-color: #fed7aa;
}

.admin-v2-safety-banner h3, .admin-v2-safety-banner p {
  margin: 0;
}

.admin-v2-safety-banner p {
  color: #334155;
  margin-top: 4px;
}

.admin-v2-safety-banner dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.admin-v2-safety-banner dt, .admin-v2-safety-banner dd {
  margin: 0;
}

.admin-v2-safety-banner dt {
  color: #64748b;
  font-size: .76rem;
  font-weight: 900;
}

.admin-v2-safety-banner dd {
  color: #0f172a;
  font-weight: 950;
}

.admin-v2-safe-note {
  color: #15803d;
  margin: 0;
  font-size: .86rem;
  font-weight: 900;
}

.admin-v2-issue-list, .admin-v2-policy-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}

.admin-v2-issue-list li, .admin-v2-policy-list li {
  color: #334155;
  line-height: 1.5;
}

.admin-v2-issue-list strong, .admin-v2-issue-list span {
  display: block;
}

.admin-v2-issue-list span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 850;
}

.admin-v2-data-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 2px;
}

.admin-v2-data-tabs button.active {
  color: #4f4bcc;
  background: #eef2ff;
  border-color: #4f4bcc;
}

@media (min-width: 861px) {
  .admin-v2-topbar {
    min-height: 56px;
    padding: 9px 18px;
  }

  .admin-v2-brand {
    gap: 10px;
  }

  .admin-v2-brand h1 {
    font-size: .98rem;
  }

  .admin-v2-mark {
    border-radius: 7px;
    width: 26px;
    height: 26px;
    font-size: .72rem;
  }

  .admin-v2-env {
    min-height: 20px;
    margin-top: 2px;
    padding: 0 8px;
    font-size: .68rem;
  }

  .admin-v2-updated {
    font-size: .78rem;
  }

  .admin-v2-refresh, .admin-v2-logout, .admin-v2-filter-actions button, .admin-v2-panel-head button, .admin-v2-table-footer button, .admin-v2-data-tabs button {
    border-radius: 7px;
    min-height: 32px;
    padding: 0 10px;
    font-size: .76rem;
  }

  .admin-v2-layout {
    grid-template-columns: 204px minmax(0, 1fr);
    min-height: calc(100vh - 56px);
  }

  .admin-v2-sidebar {
    height: calc(100vh - 56px);
    padding: 18px 12px;
    top: 56px;
  }

  .admin-v2-nav {
    gap: 6px;
  }

  .admin-v2-nav button {
    border-radius: 8px;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    font-size: .82rem;
  }

  .admin-v2-operator {
    grid-template-columns: 30px minmax(0, 1fr);
    border-radius: 8px;
    gap: 8px;
    padding: 9px;
  }

  .admin-v2-operator > span {
    width: 30px;
    height: 30px;
    font-size: .76rem;
  }

  .admin-v2-operator strong {
    font-size: .78rem;
  }

  .admin-v2-operator p {
    font-size: .7rem;
  }

  .admin-v2-main {
    padding: 18px 26px 24px;
  }

  .admin-v2-view {
    gap: 12px;
    width: min(100%, 1500px);
  }

  .admin-v2-section-head {
    gap: 10px;
  }

  .admin-v2-section-head h2 {
    font-size: 1.42rem;
  }

  .admin-v2-section-head span {
    font-size: .82rem;
  }

  .admin-v2-action-grid, .admin-v2-metric-grid, .admin-v2-overview-grid, .admin-v2-two-column, .admin-v2-three-column {
    gap: 10px;
  }

  .admin-v2-metric-grid-wide {
    grid-template-columns: repeat(7, minmax(112px, 1fr));
  }

  .admin-v2-action-card, .admin-v2-metric, .admin-v2-panel, .admin-v2-table-card, .admin-v2-drawer, .admin-v2-empty-state {
    border-radius: 10px;
    box-shadow: 0 6px 18px #0f172a09;
  }

  .admin-v2-action-card {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 3px 12px;
    min-height: 96px;
    padding: 14px;
  }

  .admin-v2-action-card span:not(.admin-v2-action-icon) {
    font-size: .82rem;
  }

  .admin-v2-action-card strong {
    font-size: 1.66rem;
  }

  .admin-v2-action-card small, .admin-v2-action-card em {
    font-size: .72rem;
  }

  .admin-v2-action-card em {
    min-height: 26px;
    padding: 0 9px;
  }

  .admin-v2-action-icon {
    border-radius: 10px;
    width: 40px;
    height: 40px;
  }

  .admin-v2-metric {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 3px 10px;
    min-height: 68px;
    padding: 11px;
  }

  .admin-v2-metric-icon {
    border-radius: 10px;
    width: 34px;
    height: 34px;
  }

  .admin-v2-metric-label {
    font-size: .7rem;
  }

  .admin-v2-metric strong {
    font-size: 1.42rem;
  }

  .admin-v2-metric-detail {
    font-size: .68rem;
  }

  .admin-v2-badge {
    border-radius: 5px;
    min-height: 20px;
    padding: 0 7px;
    font-size: .68rem;
  }

  .admin-v2-panel, .admin-v2-table-card {
    gap: 9px;
    padding: 12px;
  }

  .admin-v2-panel-head {
    gap: 9px;
  }

  .admin-v2-panel-head h3 {
    font-size: .9rem;
  }

  .admin-v2-compact-rows div, .admin-v2-detail-grid div {
    gap: 10px;
    padding: 7px 0;
  }

  .admin-v2-compact-rows dt, .admin-v2-detail-grid dt {
    font-size: .74rem;
  }

  .admin-v2-compact-rows dd, .admin-v2-detail-grid dd {
    font-size: .84rem;
  }

  .admin-v2-source-health {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 12px;
  }

  .admin-v2-donut {
    width: 88px;
    height: 88px;
  }

  .admin-v2-empty-state {
    padding: 14px;
  }

  .admin-v2-success-note {
    border-radius: 7px;
    padding: 9px;
    font-size: .78rem;
  }

  .admin-v2-filterbar {
    grid-template-columns: repeat(6, minmax(108px, 1fr));
    border-radius: 10px;
    gap: 8px;
    padding: 9px;
  }

  .admin-v2-filterbar label {
    gap: 5px;
    font-size: .7rem;
  }

  .admin-v2-search-filter div {
    border-radius: 7px;
    padding: 0 9px;
  }

  .admin-v2-search-filter input {
    padding: 7px 0;
  }

  .admin-v2-feedback-workspace, .admin-v2-split-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 12px;
  }

  .admin-v2-table {
    min-width: 840px;
  }

  .admin-v2-table th {
    padding: 8px 10px;
    font-size: .68rem;
  }

  .admin-v2-table td {
    padding: 8px 10px;
    font-size: .76rem;
    line-height: 1.35;
  }

  .admin-v2-table td > span {
    font-size: .68rem;
  }

  .admin-v2-table-link, .admin-v2-copy-id {
    font-size: .76rem;
  }

  .admin-v2-table-footer {
    font-size: .74rem;
  }

  .admin-v2-drawer {
    gap: 9px;
    max-height: calc(100vh - 82px);
    padding: 12px;
    top: 68px;
  }

  .admin-v2-drawer-head {
    gap: 9px;
    padding-bottom: 9px;
  }

  .admin-v2-drawer-head h3 {
    font-size: .94rem;
  }

  .admin-v2-drawer-head button {
    width: 32px;
    height: 32px;
  }

  .admin-v2-detail-stack {
    gap: 9px;
  }

  .admin-v2-detail-block {
    gap: 4px;
  }

  .admin-v2-detail-block span, .admin-v2-review-note span, .admin-v2-editor-grid span {
    font-size: .7rem;
  }

  .admin-v2-detail-block p {
    font-size: .82rem;
    line-height: 1.45;
  }

  .admin-v2-detail-block.strong p {
    font-size: .9rem;
  }

  .admin-v2-guide-card {
    border-radius: 8px;
    gap: 6px;
    padding: 9px;
  }

  .admin-v2-guide-card p, .admin-v2-guide-card small {
    font-size: .78rem;
    line-height: 1.4;
  }

  .admin-v2-editor-grid {
    gap: 8px;
  }

  .admin-v2-review-note textarea {
    min-height: 76px;
  }

  .admin-v2-primary-action, .admin-v2-danger-action, .admin-v2-external-link {
    border-radius: 7px;
    min-height: 34px;
    padding: 0 10px;
    font-size: .78rem;
  }

  .admin-v2-tech-details {
    border-radius: 8px;
    padding: 8px 10px;
  }

  .admin-v2-safety-banner {
    grid-template-columns: 42px minmax(0, 1fr) minmax(280px, .95fr);
    border-radius: 10px;
    gap: 12px;
    padding: 12px;
  }

  .admin-v2-safety-banner h3 {
    font-size: 1rem;
  }

  .admin-v2-safety-banner p, .admin-v2-safe-note {
    font-size: .8rem;
  }

  .admin-v2-safety-banner dl {
    gap: 8px;
  }

  .admin-v2-safety-banner dt {
    font-size: .68rem;
  }

  .admin-v2-safety-banner dd {
    font-size: .84rem;
  }

  .admin-v2-issue-list, .admin-v2-policy-list {
    gap: 6px;
    font-size: .82rem;
  }
}

@media (max-width: 1180px) {
  .admin-v2-action-grid, .admin-v2-overview-grid, .admin-v2-metric-grid, .admin-v2-metric-grid-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-v2-three-column, .admin-v2-feedback-workspace, .admin-v2-split-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-v2-drawer {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .admin-v2-topbar {
    position: static;
    flex-direction: column;
    align-items:  flex-start;
    padding: 14px;
  }

  .admin-v2-topbar-actions {
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
  }

  .admin-v2-updated {
    white-space: normal;
    width: 100%;
  }

  .admin-v2-layout {
    display: block;
    min-height: auto;
  }

  .admin-v2-sidebar {
    display: none;
  }

  .admin-v2-main {
    padding: 14px;
  }

  .admin-v2-mobile-nav {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
  }

  .admin-v2-mobile-nav label {
    color: #64748b;
    font-size: .78rem;
    font-weight: 950;
  }

  .admin-v2-section-head {
    display: grid;
    align-items:  start;
    gap: 6px;
  }

  .admin-v2-section-head h2 {
    font-size: 1.35rem;
  }

  .admin-v2-action-grid, .admin-v2-overview-grid, .admin-v2-two-column, .admin-v2-metric-grid, .admin-v2-metric-grid-wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-v2-action-card {
    min-height: 112px;
    padding: 15px;
  }

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

  .admin-v2-search-filter {
    grid-column: auto;
  }

  .admin-v2-filter-actions {
    align-items: stretch;
  }

  .admin-v2-filter-actions button {
    flex: 1;
    min-height: 44px;
  }

  .admin-v2-feedback-workspace .admin-v2-table-scroll {
    display: none;
  }

  .admin-v2-mobile-cards {
    display: grid;
    gap: 10px;
  }

  .admin-v2-mobile-cards button {
    display: grid;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    gap: 8px;
    width: 100%;
    min-height: 104px;
    padding: 13px;
  }

  .admin-v2-mobile-cards button.selected {
    background: #eef2ff;
    border-color: #4f4bcc;
  }

  .admin-v2-mobile-cards button > span {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .admin-v2-mobile-cards strong {
    color: #0f172a;
    word-break: keep-all;
    line-height: 1.45;
  }

  .admin-v2-mobile-cards small {
    color: #64748b;
    font-size: .78rem;
    font-weight: 850;
  }

  .admin-v2-drawer:not(.admin-v2-drawer-empty) {
    position: fixed;
    z-index: 80;
    overflow: auto;
    border-radius: 0;
    max-height: none;
    padding: 18px;
    inset: 0;
  }

  .admin-v2-drawer-empty {
    display: none;
  }

  .admin-v2-editor-grid, .admin-v2-source-health, .admin-v2-safety-banner, .admin-v2-safety-banner dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-v2-table {
    min-width: 760px;
  }
}

@media (min-width: 640px) {
  .app-shell {
    width: min(1180px, 100vw - 40px);
    padding-top: 18px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    border-radius: var(--radius-lg);
    align-items:  center;
    gap: 18px;
    margin: 0;
    padding: 12px;
  }

  .segmented {
    width: 280px;
  }

  .current-view-label {
    justify-self: end;
  }

  .chat-hero {
    padding-top: 24px;
  }

  .chat-hero h2 {
    font-size: 2.4rem;
  }

  .search-composer {
    grid-template-columns: minmax(0, 1fr) auto;
    border-radius: var(--radius-xl);
    align-items: stretch;
    padding: 8px;
  }

  .composer-field {
    align-items:  center;
  }

  .composer-field svg {
    margin: 0 0 0 10px;
  }

  .composer-field textarea {
    resize: none;
    height: 58px;
    min-height: 58px;
    max-height: 128px;
    padding: 15px 10px;
  }

  .has-answer .composer-field textarea {
    height: 58px;
    min-height: 58px;
  }

  .composer-submit {
    width: auto;
    min-width: 132px;
    min-height: 58px;
    padding: 0 22px;
  }

  .has-answer .composer-submit {
    min-height: 58px;
  }

  .sample-row {
    overflow: visible;
    mask-image: none;
    scroll-snap-type: none;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0;
    padding: 0 0 5px;
  }

  .answer-action-row button, .answer-action-row a {
    flex: 0 auto;
    padding-inline-start: 16px;
    padding-inline-end: 16px;
  }

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

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

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

  .source-grid.single-source .source-card {
    grid-template-columns: minmax(0, 1fr) minmax(190px, .62fr) auto;
    align-items:  center;
  }

  .source-grid.single-source .source-link {
    min-width: 104px;
  }

  .related-row button {
    text-align: center;
    flex: 0 auto;
    justify-content: center;
    max-width: 360px;
  }

  .feedback-row button {
    flex: 132px;
  }

  .admin-page-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items:  end;
  }

  .admin-lock-button {
    width: max-content;
  }

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

  .admin-filter-row, .admin-status-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  h1 {
    font-size: 1.52rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .app-shell {
    padding-bottom: 48px;
  }

  .chat-experience {
    gap: 18px;
  }

  .chat-hero h2 {
    font-size: 2.75rem;
  }

  .answer-stack {
    gap: 18px;
  }

  .details-dialog-backdrop {
    align-items:  center;
    padding: 24px;
  }

  .details-dialog {
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 70px #0f172a33;
  }

  .dialog-source-grid.single-source .source-card {
    grid-template-columns: minmax(0, 1fr) minmax(190px, .62fr) auto;
    align-items:  center;
  }

  .dialog-source-grid.single-source .source-link {
    min-width: 104px;
  }

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

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

  .admin-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

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

  .admin-item {
    align-items:  start;
  }

  .admin-item:has( > button) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-item:has( > .badge) {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .admin-list:has(.admin-review-table) {
    grid-column: 1 / -1;
  }

  .admin-list:has(.admin-status-matrix) {
    grid-column: 1 / -1;
  }

  .admin-list:has(.chunk-preview) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1100px) {
  .topbar {
    position: sticky;
    padding-top: 16px;
    padding-bottom: 22px;
    top: 14px;
  }

  .chat-experience {
    width: min(960px, 100%);
  }

  .chat-hero {
    padding-top: 34px;
  }

  .chat-hero h2 {
    font-size: 3rem;
  }

  .answer-card, .source-section, .related-panel, .feedback-panel {
    padding: 20px;
  }
}

.segmented .segment {
  color: var(--text-soft);
  -webkit-text-fill-color: var(--text-soft);
  opacity: 1;
}

.segmented .segment svg {
  color: currentColor;
}

.segmented .segment:not(.active) svg {
  color: var(--text-soft);
  stroke: var(--text-soft);
}

.segmented .segment.active {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

.segmented .segment.active svg {
  color: #fff;
  stroke: #fff;
}
