/* Shared components. Colors come from base.css tokens only. */

.site-header {
  position: relative;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 64px;
}

.site-header__logo {
  color: var(--c-text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header__logo span {
  color: var(--c-primary);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.site-header__nav a {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
}

.site-header__nav a:hover,
.site-header__nav a[aria-current="page"] {
  color: var(--c-primary-text);
}

.site-header__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
}

.site-header__toggle svg {
  width: 20px;
  height: 20px;
}

.site-footer {
  margin-top: var(--sp-12);
  padding-block: var(--sp-6);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-subtle);
  font-size: var(--fs-tiny);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.site-footer a {
  color: var(--c-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--c-primary-text);
}

.breadcrumb {
  margin-bottom: var(--sp-4);
  color: var(--c-text-subtle);
  font-size: var(--fs-tiny);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: var(--sp-2);
  color: var(--c-text-subtle);
}

.breadcrumb a {
  color: var(--c-text-muted);
  text-decoration: none;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  border: 2px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  text-align: center;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
}

.dropzone__icon {
  width: 40px;
  height: 40px;
  color: var(--c-primary);
}

.dropzone__title {
  margin: 0;
  font-weight: 700;
}

.dropzone__hint,
.dropzone__paste {
  margin: 0;
  color: var(--c-text-subtle);
  font-size: var(--fs-small);
}

.dropzone__error {
  margin: 0;
  color: var(--c-danger);
  font-size: var(--fs-small);
}

.previews {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 0;
  padding: 0;
  list-style: none;
}

.file-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.file-preview__thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--c-surface-alt);
}

.file-preview__name {
  font-weight: 600;
  word-break: break-word;
}

.file-preview__meta {
  color: var(--c-text-subtle);
  font-size: var(--fs-tiny);
}

.file-preview__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.lang-select {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.lang-select__note {
  color: var(--c-text-subtle);
  font-size: var(--fs-tiny);
}

.progress {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.progress__bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--c-surface-alt);
}

.progress__bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--c-primary);
}

.progress__stage {
  margin: var(--sp-2) 0 0;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.progress__cancel {
  margin-top: var(--sp-3);
}

.table-editor {
  margin-top: var(--sp-4);
}

.table-editor__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.table-editor table {
  min-width: 640px;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.table-editor th,
.table-editor td {
  min-width: 96px;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  vertical-align: top;
}

.table-editor th {
  background: var(--c-surface-alt);
  font-size: var(--fs-tiny);
  color: var(--c-text-muted);
}

.table-editor td:first-child,
.table-editor th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 44px;
  background: var(--c-surface);
  box-shadow: 1px 0 0 var(--c-border);
}

.table-editor th:first-child {
  z-index: 2;
  background: var(--c-surface-alt);
}

.table-editor td[contenteditable="true"] {
  cursor: text;
}

.table-editor td.cell--low,
.table-editor td.cell--low:first-child {
  background: var(--c-warn-bg);
  color: var(--c-warn);
}

.confidence-legend {
  margin-top: var(--sp-3);
  color: var(--c-warn);
  font-size: var(--fs-small);
}

.confidence-legend::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: var(--sp-2);
  vertical-align: -1px;
  border-radius: 2px;
  background: var(--c-warn-bg);
  box-shadow: inset 0 0 0 1px var(--c-warn);
}

.export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.export-bar__name {
  flex-basis: 100%;
  margin: 0;
  color: var(--c-text-subtle);
  font-size: var(--fs-tiny);
}

.how-it-works {
  display: grid;
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.how-it-works li {
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.how-it-works li::before {
  counter-increment: step;
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: var(--sp-2);
  border-radius: var(--r-full);
  background: var(--c-primary);
  color: var(--c-surface);
  font-size: var(--fs-small);
  font-weight: 700;
}

.example-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}

.example-card img {
  border-radius: var(--r-sm);
  background: var(--c-surface-alt);
}

.example-card figcaption {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.faq-item {
  border-bottom: 1px solid var(--c-border);
}

.faq-item summary {
  padding: var(--sp-4) 0;
  font-weight: 600;
  cursor: pointer;
}

.faq-item p {
  margin: 0 0 var(--sp-4);
  color: var(--c-text-muted);
}

.cta-banner {
  margin-top: var(--sp-8);
  padding: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-primary-soft);
}

.cta-banner p {
  color: var(--c-text-muted);
}

.ad-slot {
  visibility: hidden;
  min-height: 90px;
  margin-block: var(--sp-6);
  background: var(--c-surface-alt);
}

.ad-slot--desktop {
  min-height: 90px;
}

.tool__unsupported {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--c-warn-bg);
  color: var(--c-warn);
}

@media (max-width: 639px) {
  .site-header__toggle {
    display: inline-flex;
  }

  .site-header__nav {
    display: none;
    position: absolute;
    z-index: 3;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) var(--sp-4) var(--sp-4);
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
  }

  .site-header.is-open .site-header__nav {
    display: flex;
  }

  .site-header__nav a {
    padding: var(--sp-3) 0;
  }
}

@media (min-width: 1024px) {
  .ad-slot--desktop {
    min-height: 250px;
  }
}
