@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&display=swap");

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --text: #24313f;
  --muted: #6b7785;
  --line: #dde5ee;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --sidebar: #172033;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --shadow: 0 12px 32px rgba(20, 32, 50, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Thai", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

button {
  min-height: 38px;
}

a {
  color: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: 280px;
  height: 100vh;
  flex: 0 0 280px;
  overflow-y: auto;
  background: var(--sidebar);
  color: #fff;
  padding: 18px 14px;
}

.brand {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 4px;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  line-height: 1.25;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--sidebar-hover);
  outline: none;
}

.nav-link.active {
  background: #2563eb;
  color: #fff;
}

.nav-mark {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

.sidebar-backdrop {
  display: none;
}

.main-panel {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

.mobile-topbar {
  display: none;
}

.page-banner {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-banner h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0;
}

.page-banner p {
  margin: 0;
  max-width: 920px;
  color: rgba(255, 255, 255, 0.86);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.home-action-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.15fr);
  gap: 14px;
  margin-bottom: 14px;
}

.home-panel {
  display: grid;
  align-content: space-between;
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.home-panel-form {
  border-top: 6px solid var(--primary);
}

.home-panel-data {
  border-top: 6px solid var(--accent);
}

.home-panel-kicker {
  width: fit-content;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.home-panel-data .home-panel-kicker {
  background: #eaf7ef;
  color: #0f766e;
}

.home-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.35;
}

.home-panel p {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.7;
}

.home-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.home-data-section {
  display: grid;
  gap: 12px;
}

.home-data-section .section-title {
  margin-bottom: 0;
}

.home-data-section .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.card h2,
.card h3,
.card h4 {
  margin: 0 0 12px;
  line-height: 1.35;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.7;
}

.action-row,
.toolbar,
.form-actions,
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dashboard-toolbar input,
.dashboard-toolbar select {
  width: auto;
  min-width: 140px;
}

.dashboard-toolbar input {
  min-width: 220px;
}

.pagination-toolbar {
  justify-content: flex-end;
  font-size: 13px;
}

.pagination-toolbar select {
  width: auto;
  min-width: 72px;
}

.table-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover,
.button:focus-visible {
  background: #eef2f7;
  outline: none;
}

.button.primary {
  background: var(--primary);
  color: #fff;
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--primary-dark);
}

.button.success {
  background: var(--accent);
  color: #fff;
}

.add-author-button {
  border-color: #12833c;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.2);
  font-weight: 700;
}

.add-author-button:hover,
.add-author-button:focus-visible {
  background: #12833c;
}

.button.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.button.danger:hover,
.button.danger:focus-visible {
  border-color: #fca5a5;
  background: #fee2e2;
  color: #991b1b;
}

.button.ghost {
  border-color: var(--line);
}

.button.small {
  min-width: 0;
  min-height: 32px;
  padding: 5px 10px;
  font-size: 13px;
}

.link-button {
  display: inline;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-button:hover,
.link-button:focus-visible {
  color: var(--primary-dark);
  outline: none;
}

.table-title-link {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 600;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.type-card {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.type-card:hover,
.type-card:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.type-card.academic {
  border-left-color: #0f766e;
}

.type-card.research {
  border-left-color: #d97706;
}

.type-card.km {
  border-left-color: #7c3aed;
}

.type-name {
  font-size: 18px;
  font-weight: 700;
}

.type-desc {
  color: var(--muted);
  line-height: 1.55;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: #334155;
  font-weight: 600;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.form-section {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.section-title h3 {
  margin: 0;
}

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

.author-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.existing-files {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.existing-files-title {
  color: var(--text);
  font-weight: 700;
}

.file-category-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.file-category-title {
  color: var(--text);
  font-weight: 700;
}

.file-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.file-category-name {
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.file-category-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
}

.author-grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.status-message {
  min-height: 24px;
  color: var(--danger);
  font-size: 14px;
}

.success-message {
  color: var(--accent);
}

.hidden,
[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  z-index: 1200;
}

.modal.open {
  display: flex;
}

.modal-box {
  width: min(760px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

.dashboard-detail-modal {
  width: min(860px, 100%);
}

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

.detail-header h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.detail-body {
  display: grid;
  gap: 16px;
}

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

.detail-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.detail-item span {
  color: var(--muted);
  font-size: 13px;
}

.detail-item strong {
  color: var(--text);
  font-weight: 600;
  line-height: 1.65;
  word-break: break-word;
}

.detail-section h4 {
  margin: 0 0 8px;
}

.detail-files {
  display: grid;
  gap: 8px;
  line-height: 1.6;
}

.detail-file-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  color: var(--text);
  text-decoration: none;
}

.detail-file-card:hover,
.detail-file-card:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.detail-file-card.unavailable {
  background: #f8fafc;
  color: var(--muted);
}

.detail-file-icon {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 6px;
  background: #dbeafe;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.detail-file-card.unavailable .detail-file-icon {
  background: #e2e8f0;
  color: #64748b;
}

.detail-file-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-file-info strong {
  line-height: 1.4;
  word-break: break-word;
}

.detail-file-info span {
  color: var(--muted);
  font-size: 13px;
}

.empty-state.compact {
  padding: 12px;
  text-align: left;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
}

.preview-list {
  display: grid;
  gap: 10px;
  line-height: 1.65;
}

.preview-file img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.preview-file iframe {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.duplicate-alert {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #fbbf24;
  border-left: 5px solid #f59e0b;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #78350f;
}

.duplicate-alert strong {
  color: #92400e;
}

.duplicate-alert p {
  margin: 0;
  color: #92400e;
}

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

.duplicate-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: #fff;
}

.duplicate-item span {
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
}

.duplicate-item strong {
  color: var(--text);
  line-height: 1.5;
}

.loading-panel {
  display: grid;
  place-items: center;
  min-height: 120px;
  color: #fff;
  font-size: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

th:first-child,
td:first-child {
  width: 36%;
}

th:last-child,
td:last-child {
  width: 128px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  word-break: break-word;
}

th {
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

tr:hover td {
  background: #fbfdff;
}

.mobile-list {
  display: none;
}

.mobile-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.mobile-title {
  font-weight: 700;
  line-height: 1.45;
}

.mobile-row {
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
}

.empty-state {
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.summary-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-box b {
  font-size: 28px;
}

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

.chart-box {
  position: relative;
  height: 320px;
}

.quality-toolbar input {
  min-width: 260px;
  flex: 1 1 260px;
}

.quality-toolbar select {
  min-width: 180px;
}

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

.quality-stat {
  display: grid;
  gap: 8px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.quality-stat.complete {
  border-top-color: #16a34a;
}

.quality-stat.warning {
  border-top-color: #f59e0b;
}

.quality-stat.danger {
  border-top-color: #ef4444;
}

.quality-stat span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quality-stat b {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.quality-list-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.quality-list-section .section-title {
  margin-top: 0;
  margin-bottom: 14px;
}

.quality-list-section .section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.quality-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid #16a34a;
  border-radius: var(--radius);
  background: #fff;
}

.quality-card.needs-review {
  border-left-color: #f59e0b;
  background: #fffdf7;
}

.quality-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.quality-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quality-card h4 {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.quality-type,
.issue-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.quality-type {
  background: #dbeafe;
  color: #1d4ed8;
}

.quality-type.academic {
  background: #ccfbf1;
  color: #0f766e;
}

.quality-type.research {
  background: #fed7aa;
  color: #c2410c;
}

.quality-type.km {
  background: #ede9fe;
  color: #6d28d9;
}

.quality-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quality-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  color: var(--muted);
  line-height: 1.55;
}

.quality-meta strong {
  color: var(--text);
}

.issue-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.issue-chip.ok {
  background: #dcfce7;
  color: #166534;
}

.issue-chip.warning {
  background: #fef3c7;
  color: #92400e;
}

.issue-chip.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.quality-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.guide-switcher {
  margin-bottom: 14px;
}

.guide-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.guide-tab {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.guide-tab:hover,
.guide-tab:focus-visible {
  background: #eef2f7;
  color: var(--text);
  outline: none;
}

.guide-tab.active {
  background: var(--primary);
  color: #fff;
}

.guide-panel {
  display: none;
}

.guide-panel.active {
  display: block;
}

.guide-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.guide-summary-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.guide-summary-card.innovation {
  border-top-color: var(--primary);
}

.guide-summary-card.km {
  border-top-color: #7c3aed;
}

.guide-summary-card.research {
  border-top-color: #d97706;
}

.guide-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.guide-summary-card strong {
  line-height: 1.55;
}

.guide-infographic {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.infographic-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.infographic-header span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.infographic-header h3 {
  margin: 0;
  line-height: 1.35;
}

.infographic-header strong {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #334155;
  font-size: 13px;
}

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

.infographic-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
}

.infographic-card::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  z-index: 1;
  width: 20px;
  height: 20px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0.28;
  transform: translateY(-50%) rotate(45deg);
}

.infographic-card:last-child::after {
  display: none;
}

.infographic-card.phase-1 {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.infographic-card.phase-2 {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.infographic-card.phase-3 {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.infographic-card.phase-4 {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.infographic-step {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: currentColor;
  color: #fff;
  font-weight: 800;
}

.infographic-content {
  min-width: 0;
}

.infographic-content span {
  display: block;
  margin-bottom: 4px;
  color: currentColor;
  font-size: 13px;
  font-weight: 800;
}

.infographic-content strong {
  display: block;
  color: var(--text);
  line-height: 1.4;
}

.infographic-content p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.guide-route {
  min-width: 0;
}

.guide-route .section-title {
  margin-bottom: 12px;
}

.guide-route .section-title h3,
.guide-aside h3 {
  margin: 0 0 8px;
  line-height: 1.35;
}

.guide-route .section-title p,
.guide-actions-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.route-steps {
  display: grid;
  gap: 12px;
}

.route-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.route-step-number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #dbeafe;
  color: var(--primary-dark);
  font-weight: 800;
}

.route-step-body {
  min-width: 0;
}

.route-step h4 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.4;
}

.route-step dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.route-step dl > div {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 10px;
}

.route-step dt {
  color: #334155;
  font-weight: 700;
}

.route-step dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.guide-aside {
  display: grid;
  gap: 14px;
}

.guide-checklist,
.guide-actions-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.guide-checklist ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.guide-action-buttons {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.guide-action-buttons .button {
  width: 100%;
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 18px;
}

.login-box {
  width: min(360px, 100%);
}

.login-logo {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin: 0 auto 12px;
}

@media (max-width: 1100px) {
  .home-action-grid {
    grid-template-columns: 1fr;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: min(300px, calc(100vw - 72px));
    height: 100dvh;
    transform: translateX(calc(-100% - 18px));
    box-shadow: 16px 0 34px rgba(15, 23, 42, 0.28);
    transition: transform 0.2s ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 990;
    background: rgba(15, 23, 42, 0.45);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .main-panel {
    width: 100%;
    padding: 88px 14px 14px;
  }

  .mobile-topbar {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 980;
    display: block;
    pointer-events: none;
  }

  .mobile-title {
    display: none;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 60px;
    min-width: 60px;
    height: 60px;
    min-height: 60px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 32px;
    line-height: 1;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
    pointer-events: auto;
  }

  .menu-toggle:hover,
  .menu-toggle:focus-visible {
    background: var(--primary-dark);
    outline: none;
  }

  .page-banner {
    padding: 16px;
  }

  .page-banner h1 {
    font-size: 22px;
  }

  .field-grid,
  .detail-grid,
  .chart-grid,
  .quality-summary-grid,
  .quality-meta,
  .guide-summary-grid,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .quality-card {
    grid-template-columns: 1fr;
  }

  .quality-actions {
    justify-content: flex-start;
  }

  .guide-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    width: 100%;
  }

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

  .infographic-card::after {
    display: none;
  }

  .author-grid {
    grid-template-columns: 1fr;
  }

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

  .table-wrap {
    display: none;
  }

  .mobile-list {
    display: block;
  }
}

@media (max-width: 520px) {
  .main-panel {
    padding: 84px 12px 12px;
  }

  .mobile-topbar {
    top: 12px;
    left: 12px;
  }

  .menu-toggle {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    font-size: 30px;
  }

  .card,
  .page-banner {
    padding: 14px;
  }

  .home-panel {
    min-height: 0;
    padding: 16px;
  }

  .home-panel h2 {
    font-size: 21px;
  }

  .detail-header {
    display: grid;
  }

  .route-step {
    grid-template-columns: 1fr;
  }

  .infographic-header {
    display: grid;
  }

  .infographic-flow {
    grid-template-columns: 1fr;
  }

  .route-step dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .toolbar,
  .action-row,
  .home-panel-actions,
  .form-actions,
  .modal-actions {
    align-items: stretch;
  }

  .button,
  .home-panel-actions .button,
  .toolbar input,
  .toolbar select {
    width: 100%;
  }
}
