:root {
  --bg: #f8fafc;
  --deep: #0b1120;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #f59e0b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text-soft: #64748b;
  --panel: rgba(255, 255, 255, 0.9);
  --danger: #dc2626;
  --warn: #d97706;
  --yellow: #ca8a04;
  --success: #16a34a;
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.12);
  --shadow-sm: 0 4px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--deep);
  background: var(--bg);
}

body.locked {
  overflow: hidden;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.app-body {
  min-height: 100vh;
  position: relative;
}

.landing-view {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: opacity 0.5s ease;
}

.ambient-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -2;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 999px;
}

.glow-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
}

.glow-2 {
  right: -10%;
  bottom: -20%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
}

.landing-header,
.report-header {
  height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-lockup.dark {
  font-size: 20px;
}

.brand-block {
  width: 10px;
  height: 26px;
  border-radius: 4px;
  background: var(--primary);
}

.landing-nav {
  color: var(--text-soft);
  font-size: 14px;
}

.landing-nav a {
  transition: color 0.18s ease;
}

.landing-nav a:hover {
  color: var(--primary);
}

.landing-main {
  flex: 1;
  width: min(1280px, calc(100% - 80px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  padding: 0 0 40px;
}

.landing-copy,
.landing-preview {
  width: 50%;
}

.copy-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
}

.landing-copy h1 {
  margin: 24px 0 20px;
  font-size: clamp(46px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.landing-copy p {
  max-width: 640px;
  margin: 0 0 36px;
  font-size: 19px;
  line-height: 1.8;
  color: var(--text-soft);
}

.copy-points {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  display: grid;
  gap: 18px;
}

.copy-points li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.point-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #dbeafe;
  position: relative;
  flex: 0 0 auto;
  margin-top: 2px;
}

.point-icon::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(45deg);
}

.copy-points strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
}

.copy-points span {
  display: block;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}

.landing-actions {
  display: flex;
  gap: 12px;
}

.primary-btn,
.secondary-btn,
.small-primary-btn {
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.small-primary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn {
  padding: 14px 24px;
  color: #fff;
  background: var(--primary);
  border-radius: 14px;
  font-weight: 800;
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.22);
}

.primary-btn:hover,
.small-primary-btn:hover {
  background: var(--primary-hover);
}

.secondary-btn {
  padding: 12px 18px;
  color: #475569;
  background: #e2e8f0;
  border-radius: 12px;
  font-weight: 700;
}

.small-primary-btn {
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-weight: 700;
}

.primary-btn.wide {
  min-width: 144px;
}

.landing-preview {
  display: flex;
  justify-content: center;
  align-items: center;
}

.preview-card {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: var(--shadow-lg);
  animation: floatCard 6s ease-in-out infinite;
}

.preview-radar-card {
  height: 224px;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  position: relative;
  overflow: hidden;
}

.preview-grid {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(var(--primary) 1px, transparent 1px);
  background-size: 16px 16px;
}

.preview-label {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.preview-label.top {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.preview-label.left {
  top: 74px;
  left: 24px;
}

.preview-label.right {
  top: 74px;
  right: 18px;
}

.preview-label.bottom-left {
  left: 40px;
  bottom: 22px;
}

.preview-label.bottom-right {
  right: 30px;
  bottom: 22px;
}

.preview-radar {
  position: absolute;
  inset: 0;
}

.preview-problem-card h3 {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 18px;
}

.preview-problem-item {
  padding: 14px 14px 14px 16px;
  border-left: 4px solid #ef4444;
  border-radius: 0 14px 14px 0;
  background: #fef2f2;
}

.problem-rank {
  font-size: 12px;
  font-weight: 800;
  color: #dc2626;
  margin-bottom: 6px;
}

.preview-problem-item p {
  margin: 0;
  font-size: 14px;
  color: #1e293b;
  line-height: 1.6;
}

.report-view {
  min-height: 100vh;
  padding-bottom: 80px;
}

.error-state-card {
  padding: 24px;
  border-radius: 18px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.error-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.error-state-card h3 {
  margin: 14px 0 10px;
  font-size: 24px;
}

.error-state-card p {
  margin: 0;
  color: #7c2d12;
  line-height: 1.8;
}

.error-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.report-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.report-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.case-meta {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.report-main {
  width: min(960px, calc(100% - 48px));
  margin: 32px auto 0;
  display: grid;
  gap: 40px;
}

.report-section,
.problem-card,
.action-section {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 24px;
  box-shadow: var(--shadow-sm);
}

.report-section,
.action-section {
  padding: 32px;
}

.report-section h2,
.problem-heading h2,
.action-section h2 {
  margin: 0 0 24px;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-bar {
  width: 6px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
}

.summary-layout {
  display: flex;
  align-items: center;
  gap: 40px;
}

.radar-wrap {
  width: 320px;
  max-width: 100%;
  flex: 0 0 auto;
}

.report-radar {
  width: 320px;
  max-width: 100%;
  height: 320px;
}

.dimension-summary {
  flex: 1;
  display: grid;
  gap: 16px;
  padding-left: 24px;
  border-left: 1px solid #f1f5f9;
}

.dimension-item strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.dimension-item.highlight strong {
  color: var(--danger);
}

.dimension-item span {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.75;
}

.problem-section {
  display: grid;
  gap: 16px;
}

.problem-heading p {
  margin: 8px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.problem-list {
  display: grid;
  gap: 16px;
}

.problem-card {
  overflow: hidden;
  transition: transform 0.2s ease;
}

.problem-card:hover {
  transform: translateY(-1px);
}

.problem-card.red {
  border-left: 4px solid #ef4444;
}

.problem-card.orange {
  border-left: 4px solid #f59e0b;
}

.problem-card.yellow {
  border-left: 4px solid #facc15;
}

.problem-trigger {
  width: 100%;
  padding: 22px 24px;
  background: transparent;
  text-align: left;
  position: relative;
}

.problem-trigger:hover {
  background: rgba(248, 250, 252, 0.8);
}

.problem-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.problem-topline h3 {
  margin: 0;
  font-size: 21px;
}

.type-chip {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.type-chip.red {
  background: #fee2e2;
  color: #dc2626;
}

.type-chip.orange {
  background: #ffedd5;
  color: #ea580c;
}

.type-chip.yellow {
  background: #fef9c3;
  color: #a16207;
}

.problem-impact {
  margin: 14px 0 0;
  max-width: calc(100% - 140px);
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-soft);
}

.detail-toggle-btn {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.detail-toggle-btn.red {
  background: #fef2f2;
  color: #dc2626;
}

.detail-toggle-btn.orange {
  background: #fff7ed;
  color: #ea580c;
}

.detail-toggle-btn.yellow {
  background: #fefce8;
  color: #a16207;
}

.problem-detail {
  padding: 24px;
  border-top: 1px solid #f1f5f9;
  background: rgba(248, 250, 252, 0.55);
  display: grid;
  gap: 18px;
}

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

.problem-detail h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.problem-detail p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: #475569;
}

.evidence-box {
  padding: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #475569;
}

.recommend-box {
  padding: 16px;
  border-radius: 16px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

.decision-summary-card {
  padding: 18px;
  margin-bottom: 22px;
  border-left: 4px solid var(--success);
  border-radius: 18px;
  background: #0f172a;
  color: #fff;
}

.decision-summary-card h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.decision-summary-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.8;
}

.risk-flags {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(22, 163, 74, 0.12);
  color: #22c55e;
}

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

.action-card {
  padding: 18px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.92);
}

.action-card strong {
  display: block;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.action-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.75;
  color: #94a3b8;
}

.upgrade-callout {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-top: 1px solid #1e293b;
  border-radius: 18px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
}

.upgrade-copy strong {
  display: block;
  color: #fff;
  font-size: 14px;
  margin-bottom: 6px;
}

.upgrade-copy p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.7;
}

.modal,
.processing-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.modal-mask,
.processing-mask {
  position: absolute;
  inset: 0;
}

.modal-mask {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.processing-mask {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(10px);
}

.modal-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 24px));
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-panel-compact {
  width: min(420px, calc(100% - 24px));
}

.modal-head,
.modal-foot {
  padding: 20px 24px;
  background: rgba(248, 250, 252, 0.6);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
}

.modal-head h3 {
  margin: 0 0 4px;
}

.modal-head p {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.modal-close {
  width: 32px;
  height: 32px;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  background: transparent;
}

.modal-body {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.privacy-box,
.config-hint {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.75;
}

.privacy-box {
  border: 1px solid #dbeafe;
  background: rgba(239, 246, 255, 0.8);
  color: #475569;
}

.config-hint {
  border: 1px solid #fef3c7;
  background: #fffbeb;
  color: #92400e;
}

.consult-box {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.field-block label span {
  color: var(--danger);
}

.field-block label em {
  margin-left: 6px;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}

.field-block input,
.field-block textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

.field-block input:focus,
.field-block textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-block small {
  font-size: 12px;
  color: #94a3b8;
}

.field-error {
  margin: 0;
  font-size: 12px;
  color: var(--danger);
}

.upload-box {
  padding: 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  background: #fff;
  text-align: center;
}

.upload-box:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-placeholder,
.upload-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon,
.upload-ok {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.upload-icon {
  background: #dbeafe;
  position: relative;
}

.upload-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 2px;
  height: 16px;
  background: var(--primary);
  transform: translateX(-50%);
}

.upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: translateX(-50%) rotate(-45deg);
}

.upload-ok {
  background: #dcfce7;
  position: relative;
}

.upload-ok::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  width: 12px;
  height: 20px;
  border-right: 3px solid var(--success);
  border-bottom: 3px solid var(--success);
  transform: rotate(45deg);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid #f1f5f9;
}

.processing-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(380px, calc(100% - 24px));
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 32px;
  text-align: center;
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.processing-loader {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
}

.ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

.ring.outer {
  border: 4px solid #e2e8f0;
}

.ring.inner {
  border: 4px solid var(--primary);
  border-top-color: transparent;
  animation: spin 1.4s linear infinite;
}

.processing-core {
  position: absolute;
  inset: 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  animation: pulse 2s ease-in-out infinite;
}

.processing-panel h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.processing-panel p {
  margin: 0 0 20px;
  color: var(--text-soft);
  font-size: 14px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.admin-body {
  min-height: 100vh;
  background: var(--bg);
}

.admin-gate-shell {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.admin-gate-card {
  position: relative;
  width: min(460px, 100%);
  padding: 32px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
}

.admin-gate-card h1 {
  margin: 24px 0 10px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.admin-gate-card p {
  margin: 0 0 24px;
  color: var(--text-soft);
  line-height: 1.8;
}

.admin-gate-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.admin-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.print-body {
  background: #f8fafc;
}

.print-root {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto;
}

.print-sheet {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

.print-status {
  color: var(--text-soft);
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.print-meta {
  color: var(--text-soft);
  font-size: 13px;
}

.print-section {
  margin-top: 28px;
}

.print-section h1,
.print-section h2,
.print-problem h3 {
  margin: 0 0 12px;
}

.print-decision,
.print-problem p {
  margin: 0 0 10px;
  line-height: 1.8;
  color: #334155;
}

.print-dimensions {
  display: grid;
  gap: 12px;
}

.print-dimension-item {
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.print-dimension-item strong {
  display: block;
  margin-bottom: 6px;
}

.print-dimension-item span {
  color: #475569;
  line-height: 1.7;
}

.print-problem {
  padding: 16px 0;
  border-top: 1px solid #e2e8f0;
}

.print-action-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  line-height: 1.8;
  color: #334155;
}

.admin-shell {
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.admin-panel,
.admin-list-panel,
.admin-detail-panel {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-panel {
  padding: 24px;
  margin-bottom: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 0.9fr);
  gap: 20px;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px 140px;
  gap: 12px;
  align-items: end;
}

.admin-tabs-panel {
  display: inline-flex;
  gap: 10px;
  margin: 0 0 20px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.admin-tab-btn {
  min-width: 148px;
  padding: 12px 18px;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  font-weight: 700;
}

.admin-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.admin-codes-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
  gap: 20px;
}

.admin-code-form {
  display: grid;
  gap: 16px;
}

.admin-code-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.admin-form-hint,
.admin-success-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.admin-form-hint {
  color: var(--text-soft);
}

.admin-success-text {
  color: var(--success);
}

.admin-create-btn {
  justify-self: start;
}

.admin-list-panel,
.admin-detail-panel {
  padding: 24px;
}

.admin-header {
  margin-bottom: 16px;
}

.admin-header h2 {
  margin: 6px 0 0;
  font-size: 22px;
}

.admin-header span {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.table-wrap {
  overflow: auto;
}

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

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.admin-table tbody tr {
  cursor: pointer;
}

.admin-table tbody tr:hover,
.admin-table tbody tr.active {
  background: #f8fafc;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eff6ff;
  color: var(--primary);
}

.status-pill-used {
  background: #dcfce7;
  color: #15803d;
}

.empty-text,
.detail-muted {
  color: var(--text-soft);
  font-size: 14px;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.detail-card {
  padding: 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
}

.detail-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-card p,
.detail-card li {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: #475569;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

@keyframes floatCard {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

@keyframes modalIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 1100px) {
  .landing-main,
  .admin-grid,
  .admin-codes-grid,
  .admin-filter-grid,
  .problem-evidence-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .admin-tabs-panel {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-tab-btn,
  .admin-create-btn {
    width: 100%;
  }

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

  .landing-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
    width: calc(100% - 32px);
    padding-bottom: 32px;
  }

  .landing-copy,
  .landing-preview,
  .radar-wrap,
  .report-radar {
    width: 100%;
  }

  .landing-copy h1 {
    white-space: normal;
  }

  .report-radar {
    height: 320px;
  }

  .summary-layout {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .dimension-summary {
    width: 100%;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
  }

  .problem-impact {
    max-width: 100%;
    padding-right: 0;
  }

  .detail-toggle-btn {
    position: static;
    transform: none;
    margin-top: 14px;
  }

  .upgrade-callout,
  .report-header,
  .landing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    height: auto;
    padding: 20px;
  }
}

@media (max-width: 767px) {
  .landing-view {
    min-height: auto;
  }

  .landing-header,
  .report-header {
    padding: 16px;
  }

  .brand-lockup {
    font-size: 18px;
  }

  .landing-main {
    width: calc(100% - 24px);
    gap: 24px;
    padding-bottom: 20px;
  }

  .landing-copy h1 {
    margin: 18px 0 16px;
    font-size: clamp(34px, 10vw, 44px);
    line-height: 1.1;
  }

  .landing-copy p {
    margin-bottom: 24px;
    font-size: 16px;
    line-height: 1.7;
  }

  .copy-points {
    gap: 14px;
    margin-bottom: 24px;
  }

  .copy-points strong {
    font-size: 16px;
  }

  .landing-actions,
  .modal-foot,
  .error-actions,
  .admin-gate-actions {
    flex-direction: column;
  }

  .landing-actions .primary-btn,
  .modal-foot .primary-btn,
  .modal-foot .secondary-btn,
  .error-actions .primary-btn,
  .error-actions .secondary-btn,
  .admin-gate-actions .primary-btn,
  .admin-gate-actions .secondary-btn {
    width: 100%;
  }

  .preview-card {
    width: 100%;
    padding: 18px;
    border-radius: 20px;
    animation: none;
  }

  .preview-radar-card {
    height: 208px;
    margin-bottom: 18px;
  }

  .preview-label {
    font-size: 10px;
  }

  .preview-label.left {
    left: 14px;
  }

  .preview-label.right {
    right: 10px;
  }

  .preview-label.bottom-left {
    left: 20px;
    bottom: 16px;
  }

  .preview-label.bottom-right {
    right: 16px;
    bottom: 16px;
  }

  .report-view {
    padding-bottom: 32px;
  }

  .report-main {
    width: calc(100% - 24px);
    margin-top: 20px;
    gap: 20px;
  }

  .report-section,
  .action-section {
    padding: 20px 16px;
    border-radius: 20px;
  }

  .report-section h2,
  .problem-heading h2,
  .action-section h2 {
    margin-bottom: 18px;
    font-size: 20px;
    line-height: 1.35;
  }

  .report-radar {
    height: 280px;
  }

  .problem-trigger {
    padding: 18px 16px;
  }

  .problem-topline h3 {
    font-size: 18px;
  }

  .problem-detail {
    padding: 18px 16px;
  }

  .decision-summary-card {
    margin-bottom: 16px;
  }

  .action-grid {
    gap: 12px;
  }

  .upgrade-callout {
    padding: 16px;
  }

  .modal-panel {
    width: calc(100% - 16px);
    max-height: calc(100vh - 24px);
    border-radius: 20px;
  }

  .modal-panel-compact {
    width: calc(100% - 16px);
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .modal-body {
    max-height: 60vh;
    overflow: auto;
  }

  .processing-panel {
    width: calc(100% - 24px);
    padding: 24px 18px;
    border-radius: 20px;
  }

  .admin-shell {
    width: calc(100% - 20px);
    padding-top: 16px;
  }

  .admin-panel,
  .admin-list-panel,
  .admin-detail-panel {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .landing-copy h1 {
    font-size: 32px;
  }

  .copy-tag {
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .preview-radar-card {
    height: 190px;
  }

  .preview-label.top {
    top: 12px;
  }

  .preview-label.left,
  .preview-label.right {
    top: 66px;
  }

  .report-radar {
    height: 240px;
  }
}

@media print {
  .print-root {
    width: 100%;
    margin: 0;
  }

  .print-sheet {
    box-shadow: none;
    border-radius: 0;
    padding: 0;
  }
}
