/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-weight: 600; font-size: .94rem; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  background: transparent; min-height: 44px;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn--outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn--ghost { color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--icon { padding: 8px; min-height: 40px; width: 40px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Badge */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem;
  font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
}
.badge--muted { background: var(--surface-2); color: var(--text-muted); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }

/* Tool card */
.tool-card {
  display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s;
  text-decoration: none; min-height: 76px;
}
.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.tool-card__icon {
  flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
}
.tool-card__body { flex: 1; min-width: 0; }
.tool-card__title { display: block; font-weight: 650; font-size: 1rem; }
.tool-card__desc { display: block; color: var(--text-muted); font-size: .875rem; margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tool-card__arrow { color: var(--text-muted); flex: 0 0 auto; }
.tool-card--muted .tool-card__icon { background: var(--surface-2); color: var(--text-muted); }

/* Upload */
.upload-zone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); padding: var(--space-6) var(--space-4);
  display: grid; place-items: center; gap: var(--space-2); text-align: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone__icon { color: var(--accent); }
.upload-zone__title { font-weight: 650; font-size: 1.05rem; }
.upload-zone__sub { color: var(--text-muted); font-size: .92rem; }
.upload-zone__link { color: var(--accent); font-weight: 600; text-decoration: underline; }
.upload-zone__hint { color: var(--text-muted); font-size: .8rem; margin-top: 6px; }
.upload-privacy {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  color: var(--text-muted); font-size: .82rem; margin-top: var(--space-3);
}

/* Progress */
.progress { margin: var(--space-5) 0; }
.progress__bar { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .2s ease; }
.progress__bar[data-indeterminate="true"] .progress__fill {
  width: 35%; animation: indet 1.3s ease-in-out infinite;
}
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.progress__label { margin: 10px 0 0; color: var(--text-muted); font-size: .88rem; }

/* Result */
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.result-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-4); }
.result-card__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e7f6ee; color: var(--success); }
.result-card__title { margin: 0; font-size: 1.1rem; }
.result-card__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-4); margin: 0 0 var(--space-5); }
.result-card__stats dt { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.result-card__stats dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.is-good { color: var(--success); }
.is-neutral { color: var(--text-muted); }
.result-card__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.result-card__filename { margin: var(--space-3) 0 0; font-family: var(--mono); font-size: .82rem; color: var(--text-muted); word-break: break-all; }

/* Toast */
.toast-region { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: grid; gap: 8px; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: .9rem; pointer-events: auto; }
.toast--error { background: var(--error); }

/* Search */
.search-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding-top: 12vh; }
.search-overlay__backdrop { position: absolute; inset: 0; background: rgba(16,19,26,.45); backdrop-filter: blur(2px); }
.search-dialog { position: relative; width: min(640px, 92vw); background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.search-dialog__field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.search-dialog__field input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 55vh; overflow-y: auto; }
.search-results__item { display: flex; gap: 12px; padding: 10px 12px; border-radius: var(--radius);
  color: var(--text); align-items: flex-start; }
.search-results__item:hover { background: var(--accent-soft); text-decoration: none; }
.search-results__icon { color: var(--accent); margin-top: 2px; }
.search-results__name { display: block; font-weight: 650; }
.search-results__desc { display: block; color: var(--text-muted); font-size: .84rem; }
.search-results__empty { padding: 20px; text-align: center; color: var(--text-muted); }

/* Icon sizing */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Breadcrumbs */
.breadcrumbs { font-size: .85rem; color: var(--text-muted); padding: var(--space-4) 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumbs li::after { content: '/'; margin-left: 6px; color: var(--border-strong); }
.breadcrumbs li:last-child::after { content: ''; }
.breadcrumbs a { color: var(--text-muted); }