:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --text: #12213f;
  --muted: #526281;
  --line: #d7deec;
  --accent: #1f6feb;
  --accent-soft: #eaf2ff;
  --danger: #d64545;
  --shadow: 0 8px 24px rgba(10, 22, 48, 0.08);
  font-family: "Inter", "Avenir", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(140deg, #f9fbff 0%, #f2f6ff 50%, #f7f4ff 100%);
  color: var(--text);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.hero {
  margin-bottom: 16px;
}

.resource-back-wrap {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.resource-shell {
  width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 14px;
  align-items: start;
}

.sidebar {
  order: 2;
  position: sticky;
  top: 10px;
}

.content-area {
  min-width: 0;
  order: 1;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

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

.card-feature {
  padding: 20px;
  border-width: 2px;
  box-shadow: 0 14px 30px rgba(8, 32, 83, 0.12);
  transform: translateY(-2px);
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.input-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.disclaimer {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.disclaimer li {
  margin: 6px 0;
}

textarea,
input[type="text"],
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

textarea {
  resize: vertical;
}

.options-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 12px;
  border-radius: 12px;
  background: #fbfdff;
  border: 1px solid #e6ebf7;
}

.options-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

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

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: white;
}

.btn.ghost {
  background: var(--accent-soft);
  color: #214b9e;
  border-color: #d5e3ff;
}

.btn-guide {
  color: #ffffff;
  border: 1px solid #0f766e;
  background: #14b8a6;
  border-radius: 10px;
  padding-inline: 16px;
  letter-spacing: 0.01em;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.btn-guide:hover {
  background: #0f9488;
  box-shadow: 0 8px 18px rgba(14, 165, 165, 0.24);
  transform: translateY(-1px);
}

.btn.danger {
  background: #fff4f4;
  border-color: #ffd0d0;
  color: var(--danger);
}

.site-footer {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding: 16px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
}

.footer-tab {
  text-decoration: none;
  color: #204b8d;
  font-weight: 600;
  padding: 0;
  background: transparent;
  border: 0;
}

.footer-tab:hover,
.footer-tab:focus {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.resource-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.resource-card {
  border: 1px solid #e5ebfa;
  border-radius: 10px;
  padding: 12px;
  background: #fbfdff;
}

.resource-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 6px;
}

.resource-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 600;
  color: #1f6feb;
  text-decoration: none;
}

.resource-link:hover,
.resource-link:focus {
  text-decoration: underline;
}

.status {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #c8d6f7;
  background: #f7faff;
  color: #35538e;
  margin-bottom: 10px;
}

.report-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.report-card {
  border: 1px solid #e7edfa;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfeff;
}

.report-card strong {
  display: block;
  margin-bottom: 4px;
}

.use-cases {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 10px;
}

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

.faq details {
  border: 1px solid #e7edfa;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fcfeff;
}

.faq p {
  margin: 8px 0 0;
  color: var(--muted);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.ad-unit {
  background: linear-gradient(160deg, #f8fbff, #eef4ff);
}

.ad-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .ad-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.preview-single {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-wrap {
  border: 1px solid #e2e8f4;
  border-radius: 10px;
  background: #fff;
  width: 100%;
}

.table-wrap h3 {
  margin: 10px 12px;
  color: #294173;
  font-size: 0.95rem;
}

.table-area {
  overflow: auto;
  max-height: 360px;
  border-top: 1px solid #edf1f9;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #90b0ff #f0f4ff;
  scrollbar-gutter: stable both-edges;
}

.table-area::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.table-area::-webkit-scrollbar-track {
  background: #f0f4ff;
  border-radius: 999px;
}

.table-area::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #8baaff, #6a92ff);
  border-radius: 999px;
  border: 3px solid #f0f4ff;
}

.table-area::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #718fff, #527eff);
}

.changed-cell {
  background: #fff3cd !important;
  color: #614900 !important;
  box-shadow: inset 0 0 0 1px #ffd666;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

th,
td {
  border-bottom: 1px solid #edf1f9;
  border-right: 1px solid #edf1f9;
  padding: 10px;
  font-size: 0.9rem;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.45;
}

th {
  background: #f6f9ff;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tbody tr:hover td {
  background: #f4f8ff;
}

td.row-number,
th.row-number {
  width: 54px;
  min-width: 54px;
  text-align: right;
  background: #f8fbff;
}

th:last-child,
td:last-child {
  border-right: none;
}

.profile-row {
  margin-bottom: 0;
}

.profile-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
}

@media (max-width: 900px) {
  .input-grid,
  .profile-controls {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
