:root {
  color-scheme: light;
  --page: #f3f7f4;
  --page: oklch(96.5% 0.014 156);
  --surface: #fbfcf8;
  --surface: oklch(98.8% 0.008 138);
  --surface-strong: #e8eee8;
  --surface-strong: oklch(92.5% 0.018 154);
  --ink: #17201c;
  --ink: oklch(22% 0.028 158);
  --muted: #5f6f68;
  --muted: oklch(48% 0.032 158);
  --line: #d3ddd5;
  --line: oklch(87% 0.018 156);
  --accent: #166a5e;
  --accent: oklch(46% 0.098 174);
  --accent-dark: #0d4b45;
  --accent-dark: oklch(34% 0.08 177);
  --accent-soft: #d9eee8;
  --accent-soft: oklch(91.5% 0.042 174);
  --blue: #315f8b;
  --blue: oklch(47% 0.095 246);
  --amber: #a86716;
  --amber: oklch(56% 0.122 70);
  --red: #a94643;
  --red: oklch(49% 0.112 28);
  --plum: #69507a;
  --plum: oklch(47% 0.07 315);
  --shadow: 0 18px 45px rgba(23, 32, 28, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  background:
    linear-gradient(90deg, rgba(22, 106, 94, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(22, 106, 94, 0.04) 1px, transparent 1px),
    var(--page);
  background-size: 42px 42px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 70%, white);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 28px;
  border-bottom: 1px solid color-mix(in oklch, var(--line) 80%, transparent);
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 1px 0 rgba(23, 32, 28, 0.16);
}

.brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: dot-pulse 2.2s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px var(--accent-soft);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 7px color-mix(in oklch, var(--accent-soft) 35%, transparent);
    opacity: 0.85;
  }
}

.workspace {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 340px);
  align-items: end;
  gap: 24px;
  margin-bottom: 22px;
}

.intro-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.2;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: 2.45rem;
  line-height: 1.04;
}

.intro p:last-child {
  max-width: 66ch;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.privacy-note {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 32, 28, 0.04);
}

.privacy-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--surface);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background: var(--ink);
}

.privacy-note span:last-child {
  min-width: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.stepper {
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.stepper::-webkit-scrollbar {
  display: none;
}

.stepper ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(175px, 1fr));
  gap: 8px;
  min-width: 560px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stepper li {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 10px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  font-size: 0.9rem;
  font-weight: 680;
}

.stepper li[data-state="active"] {
  color: var(--accent-dark);
  border-color: color-mix(in oklch, var(--accent) 38%, var(--line));
  background: var(--accent-soft);
}

.stepper li[data-state="done"] {
  color: var(--ink);
  background: var(--surface);
}

.step-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-strong);
  color: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.stepper li[data-state="active"] .step-index,
.stepper li[data-state="done"] .step-index {
  color: var(--surface);
  background: var(--accent);
}

.view-stack {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 96%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.view {
  padding: 24px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.view-header h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.view-note {
  max-width: 34ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
  text-align: right;
}

.type-badge {
  align-self: start;
  max-width: 100%;
  min-height: 34px;
  padding: 7px 11px;
  overflow: hidden;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid color-mix(in oklch, var(--accent) 38%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.type-option {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  min-height: 112px;
  gap: 14px;
  padding: 16px;
  color: var(--ink);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.type-option:hover {
  border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
  transform: translateY(-1px);
}

.type-option[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 38%, transparent);
}

.type-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--surface);
  font-size: 0.86rem;
  font-weight: 850;
  border-radius: var(--radius);
}

.type-mark-library {
  background: var(--blue);
}

.type-mark-forge {
  background: var(--amber);
}

.type-mark-tab {
  background: var(--plum);
}

.type-copy {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.type-copy strong {
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.22;
}

.type-copy span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.policy-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.policy-panel > div {
  min-height: 86px;
  padding: 14px;
  background: var(--surface);
}

.policy-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.policy-panel strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.35;
}

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

.upload-column,
.validation-panel,
.progress-panel,
.details-panel,
.meta-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 88%, var(--page));
}

.column-heading,
.progress-heading,
.details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.column-heading {
  justify-content: flex-start;
}

.column-heading h3,
.progress-heading h3,
.details-head h3,
.meta-panel h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.2;
}

.column-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.column-dot-base {
  background: var(--blue);
}

.column-dot-import,
.column-dot-check {
  background: var(--accent);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dropzone {
  display: grid;
  min-height: 150px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1.5px dashed color-mix(in oklch, var(--muted) 46%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in oklch, var(--surface) 94%, transparent), color-mix(in oklch, var(--surface-strong) 40%, transparent));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging,
.file-input:focus-visible + .dropzone {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.file-input:focus-visible + .dropzone {
  outline: 3px solid color-mix(in oklch, var(--accent) 70%, white);
  outline-offset: 3px;
}

.dropzone-title {
  color: var(--ink);
  font-weight: 760;
  line-height: 1.2;
}

.dropzone-subtitle {
  font-size: 0.9rem;
  line-height: 1.3;
}

.file-list,
.validation-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.file-row[data-status="valid"] {
  border-color: color-mix(in oklch, var(--accent) 42%, var(--line));
}

.file-row[data-status="invalid"] {
  border-color: color-mix(in oklch, var(--red) 50%, var(--line));
}

.file-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.file-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-status {
  min-height: 28px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  border-radius: 999px;
  background: var(--surface-strong);
  white-space: nowrap;
}

.file-row[data-status="valid"] .file-status {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.file-row[data-status="invalid"] .file-status {
  color: var(--red);
  background: color-mix(in oklch, var(--red) 12%, var(--surface));
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
}

.icon-button:hover {
  color: var(--red);
  border-color: color-mix(in oklch, var(--red) 36%, var(--line));
  background: color-mix(in oklch, var(--red) 8%, var(--surface));
}

.empty-row {
  min-height: 44px;
  padding: 11px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--surface) 60%, transparent);
}

.validation-panel {
  margin-top: 18px;
}

.validation-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  line-height: 1.4;
}

.validation-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  border-radius: 50%;
  background: var(--surface-strong);
}

.validation-item[data-state="ok"] .validation-icon {
  color: var(--surface);
  background: var(--accent);
}

.validation-item[data-state="error"] .validation-icon {
  color: var(--surface);
  background: var(--red);
}

.validation-item[data-state="warn"] .validation-icon {
  color: var(--surface);
  background: var(--amber);
}

.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.action-row-split {
  justify-content: space-between;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 140px;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-weight: 780;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  opacity: 0.48;
}

.button-primary {
  color: var(--surface);
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  border-color: color-mix(in oklch, var(--muted) 45%, var(--line));
}

.progress-panel {
  margin-bottom: 18px;
}

.progress-heading span,
.details-head span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 680;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 180ms ease-out;
}

.feedback {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.45;
}

.feedback-error {
  color: var(--red);
  border-color: color-mix(in oklch, var(--red) 50%, var(--line));
  background: color-mix(in oklch, var(--red) 9%, var(--surface));
}

.result-content {
  display: grid;
  gap: 18px;
}

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

.metric {
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric span {
  display: block;
  min-height: 34px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
  line-height: 1.3;
}

.metric strong {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-size: 1.9rem;
  line-height: 1;
}

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

.metric-warning strong {
  color: var(--amber);
}

.metric-danger strong {
  color: var(--red);
}

.metric-final strong {
  color: var(--blue);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 11px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

td {
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.meta-panel h3 {
  margin-bottom: 12px;
}

.meta-panel dl {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--line);
}

.meta-panel dt,
.meta-panel dd {
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.meta-panel dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.meta-panel dd {
  color: var(--ink);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .intro,
  .upload-grid {
    grid-template-columns: 1fr;
  }

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

  .type-grid,
  .policy-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 16px;
  }

  .topbar-status {
    max-width: 44%;
    white-space: normal;
  }

  .workspace {
    width: min(100% - 24px, 1120px);
    padding: 22px 0 36px;
  }

  h1 {
    font-size: 1.85rem;
  }

  .intro {
    gap: 16px;
  }

  .view {
    padding: 16px;
  }

  .view-header {
    display: grid;
  }

  .view-note {
    max-width: none;
    text-align: left;
  }

  .type-option {
    min-height: 96px;
  }

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

  .metric {
    min-height: 102px;
  }

  .action-row,
  .action-row-split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

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

  .file-status {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .meta-panel dl {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .brand-subtitle,
  .topbar-status span:last-child {
    display: none;
  }

  .topbar-status {
    width: 36px;
    min-width: 36px;
    justify-content: center;
    padding: 0;
  }

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

  .privacy-note {
    grid-template-columns: 1fr;
  }
}

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

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* ── Main row: brand left, connect+tools right ── */
.footer-main {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  align-items: start;
  gap: 32px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

/* ── Brand ── */
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-decoration: none;
}

.footer-brand-link img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 1px 0 rgba(23, 32, 28, 0.14);
}

.footer-brand-name {
  color: var(--ink);
  font-family: "Dancing Script", Georgia, cursive;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.footer-tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ── Right column wrapper ── */
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
}

.footer-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.footer-section-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* ── Connect icons ── */
.footer-connect-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-icon-btn {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.footer-icon-btn:hover {
  color: var(--accent-dark);
  border-color: color-mix(in oklch, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  transform: translateY(-1px);
}

/* ── Tools cards ── */
.footer-tools-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-tool-card {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-width: 148px;
  min-height: 68px;
  padding: 12px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.footer-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* NexaLibraryX — dark card with lighter border glow */
.footer-tool-nexa {
  background: #0e1320;
  border: 1px solid rgba(180, 160, 100, 0.35);
}

/* TabStackX — navy */
.footer-tool-tab {
  background: #1a2340;
  border: 1px solid rgba(100, 130, 200, 0.25);
}

/* TaskForgeX — navy (slightly lighter) */
.footer-tool-forge {
  background: #1e2a4a;
  border: 1px solid rgba(100, 130, 200, 0.25);
}

.footer-tool-name {
  display: block;
  color: #e8e8e8;
  font-size: 0.9rem;
  font-weight: 760;
  line-height: 1.25;
}

/* ── Shared calligraphic X logo mark ── */
.logo-x {
  display: inline-block;
  font-style: italic;
  font-weight: 900;
  font-family: Georgia, "Times New Roman", serif;
  background: linear-gradient(160deg, #f5c842 10%, #e08c1a 55%, #c96b10 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 2px rgba(180, 100, 10, 0.55));
  transform: skewX(-8deg) scaleX(0.88);
  letter-spacing: -0.01em;
  line-height: inherit;
}

/* On light backgrounds (topbar brand name) darken the shadow slightly */
.brand-name .logo-x {
  filter: drop-shadow(0 1px 1px rgba(150, 80, 5, 0.45));
  font-size: 1.08em;
}

.footer-tool-desc {
  display: block;
  margin-top: 4px;
  color: rgba(200, 210, 230, 0.65);
  font-size: 0.76rem;
  line-height: 1.3;
}

/* ── Bottom bar ── */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-strong) 40%, var(--surface));
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.footer-email-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-email-link:hover {
  color: var(--accent-dark);
}

.footer-copyright-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-copyright-link:hover {
  color: var(--accent-dark);
}

/* ── Footer responsive ── */
@media (max-width: 820px) {
  .footer-main {
    grid-template-columns: 1fr;
  }

  .footer-right {
    align-items: flex-start;
  }

  .footer-section {
    align-items: flex-start;
  }

  .footer-tools-grid {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .footer-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .footer-tool-card {
    min-width: 0;
    width: 100%;
  }
}

/* ============================================================
   LICENSE MODAL
   ============================================================ */

.footer-copyright-btn {
  all: unset;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.84rem;
  border-radius: 3px;
  transition: color 140ms ease;
}

.footer-copyright-btn:hover {
  color: var(--accent-dark);
}

.footer-copyright-btn:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 70%, white);
  outline-offset: 3px;
}

/* Backdrop */
.license-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 20, 16, 0.55);
  backdrop-filter: blur(4px);
  animation: backdrop-in 180ms ease;
}

.license-backdrop.is-open {
  display: block;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Modal dialog */
.license-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  width: min(640px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(12, 20, 16, 0.28);
  flex-direction: column;
  animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.license-modal.is-open {
  display: flex;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* Header */
.license-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.license-modal-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-modal-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--accent-dark);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  flex-shrink: 0;
}

.license-modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 780;
  color: var(--ink);
}

.license-close-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.license-close-btn:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-strong);
}

/* Body — scrollable */
.license-modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.license-owner {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.license-intro {
  margin: 0 0 20px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Rules list */
.license-rules {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.license-rule {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 80%, var(--page));
}

.license-rule-deny {
  border-color: color-mix(in oklch, var(--red) 28%, var(--line));
  background: color-mix(in oklch, var(--red) 4%, var(--surface));
}

.license-rule-allow {
  border-color: color-mix(in oklch, var(--accent) 32%, var(--line));
  background: color-mix(in oklch, var(--accent) 4%, var(--surface));
}

.license-rule-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
}

.license-rule-deny .license-rule-icon {
  color: var(--red);
  background: color-mix(in oklch, var(--red) 12%, var(--surface));
}

.license-rule-allow .license-rule-icon {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.license-rule strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.3;
}

.license-rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Contact row */
.license-contact {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.license-contact p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Footer */
.license-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-strong) 35%, var(--surface));
  flex-shrink: 0;
}

.license-modal-footer .button {
  min-width: 120px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .license-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 12px 12px 0 0;
    margin: auto auto 0;
    width: 100%;
  }
}

/* ============================================================
   TOPBAR RIGHT GROUP + INFO BUTTON
   ============================================================ */

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-btn {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex-shrink: 0;
  color: var(--accent-dark);
  border: 1px solid color-mix(in oklch, var(--accent) 38%, var(--line));
  border-radius: 50%;
  background: var(--accent-soft);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease, color 140ms ease;
}

.info-btn:hover {
  background: color-mix(in oklch, var(--accent-soft) 70%, var(--accent));
  border-color: var(--accent);
  color: var(--surface);
  transform: scale(1.08);
}

.info-btn:focus-visible {
  outline: 3px solid color-mix(in oklch, var(--accent) 70%, white);
  outline-offset: 3px;
}

/* ============================================================
   USER MANUAL MODAL
   ============================================================ */

.manual-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 20, 16, 0.5);
  backdrop-filter: blur(4px);
  animation: backdrop-in 180ms ease;
}

.manual-backdrop.is-open {
  display: block;
}

.manual-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 28px 72px rgba(12, 20, 16, 0.26);
  flex-direction: column;
  animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.manual-modal.is-open {
  display: flex;
}

/* Header */
.manual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: color-mix(in oklch, var(--accent-soft) 45%, var(--surface));
}

.manual-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.manual-header-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--accent-dark);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  flex-shrink: 0;
}

.manual-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 780;
  color: var(--ink);
}

.manual-close-btn {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.manual-close-btn:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface-strong);
}

/* Body */
.manual-body {
  overflow-y: auto;
  padding: 22px 20px;
  flex: 1 1 auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 24px;
}

/* Intro banner */
.manual-intro {
  padding: 14px 16px;
  border: 1px solid color-mix(in oklch, var(--accent) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--accent-soft) 55%, var(--surface));
}

.manual-intro p {
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--ink);
}

/* Section titles */
.manual-section-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-dark);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* Steps */
.manual-steps {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.manual-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--surface) 80%, var(--page));
  transition: border-color 140ms ease, background 140ms ease;
}

.manual-step:hover {
  border-color: color-mix(in oklch, var(--accent) 38%, var(--line));
  background: var(--surface);
}

.manual-step-num {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  flex-shrink: 0;
  color: var(--surface);
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 50%;
  background: var(--accent);
}

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

.manual-step-body strong {
  display: block;
  font-size: 0.94rem;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.3;
}

.manual-step-body p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Merge rules */
.manual-rules {
  display: grid;
  gap: 8px;
}

.manual-rule {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.manual-rule-badge {
  display: inline-grid;
  place-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.manual-rule-safe   { color: var(--accent-dark);  background: var(--accent-soft); }
.manual-rule-skip   { color: var(--muted);         background: var(--surface-strong); }
.manual-rule-add    { color: var(--surface);        background: var(--accent); }
.manual-rule-flag   { color: var(--red);            background: color-mix(in oklch, var(--red) 12%, var(--surface)); }

.manual-rule strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.manual-rule p {
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Privacy note */
.manual-privacy {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border: 1px solid color-mix(in oklch, var(--blue) 30%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in oklch, var(--blue) 5%, var(--surface));
}

.manual-privacy-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--blue);
  border-radius: 50%;
  background: color-mix(in oklch, var(--blue) 12%, var(--surface));
  flex-shrink: 0;
}

.manual-privacy p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.55;
}

.manual-privacy strong {
  color: var(--ink);
}

/* Supported types */
.manual-types {
  display: grid;
  gap: 8px;
}

.manual-type {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.manual-type-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--surface);
  font-size: 0.84rem;
  font-weight: 850;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.manual-type-nl { background: var(--blue); }
.manual-type-tf { background: var(--amber); }
.manual-type-ts { background: var(--plum); }

.manual-type strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.manual-type p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Footer */
.manual-footer {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-strong) 35%, var(--surface));
  flex-shrink: 0;
}

.manual-footer .button {
  min-width: 110px;
}

/* Responsive */
@media (max-width: 480px) {
  .manual-modal {
    max-height: calc(100dvh - 20px);
    border-radius: 14px 14px 0 0;
    margin: auto auto 0;
    width: 100%;
  }

  .manual-rule {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ============================================================
   SECURITY — CLIENT-SIDE PROTECTION
   ============================================================ */

/* Disable text selection across the whole page */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Re-enable selection only inside functional input fields */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Block printing / Save as PDF entirely */
@media print {
  body * {
    display: none !important;
  }
  body::after {
    display: block !important;
    content: "© 2026 Cho Sin Hong. All rights reserved. Printing and saving this page is not permitted.";
    font-size: 1rem;
    text-align: center;
    padding: 40px;
    color: #17201c;
  }
}
