/* ============================================================
   Online Office Tools — styles
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f3f5fb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: rgba(79, 70, 229, 0.1);
  --ring: rgba(79, 70, 229, 0.32);
  --success: #0f9d58;
  --danger: #dc2626;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --warn-border: rgba(245, 158, 11, 0.4);
  --warn-text: #92400e;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 18px 40px -24px rgba(15, 23, 42, 0.45);
  --radius: 16px;
  --header-h: 68px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Noto Sans Devanagari", "Nirmala UI", "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1c;
  --bg-soft: #0e1526;
  --surface: #121b2e;
  --surface-2: #17213a;
  --text: #e9eefb;
  --muted: #93a2bd;
  --border: #22304c;
  --border-strong: #33415f;
  --primary: #818cf8;
  --primary-2: #a78bfa;
  --primary-soft: rgba(129, 140, 248, 0.16);
  --ring: rgba(129, 140, 248, 0.4);
  --success: #34d399;
  --danger: #f87171;
  --warn-bg: rgba(245, 158, 11, 0.14);
  --warn-border: rgba(245, 158, 11, 0.32);
  --warn-text: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 24px 50px -24px rgba(0, 0, 0, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}

.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;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  z-index: 200;
  padding: 0.6rem 0.9rem;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

/* ---------------- Header ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

@supports (backdrop-filter: blur(10px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 18px -8px var(--ring);
  flex: none;
}

.brand-mark svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand-mark.small svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-ghost {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px -12px var(--ring);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--border);
  background: var(--surface);
}

.btn-icon:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 4.25rem 0 3rem;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  inset: -220px -10% auto -10%;
  height: 620px;
  z-index: -1;
  background: radial-gradient(
      42% 55% at 22% 35%,
      rgba(99, 102, 241, 0.28),
      transparent 70%
    ),
    radial-gradient(38% 50% at 76% 22%, rgba(168, 85, 247, 0.22), transparent 70%),
    radial-gradient(34% 48% at 55% 68%, rgba(6, 182, 212, 0.16), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
}

[data-theme="dark"] .hero-glow {
  opacity: 0.75;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  font-size: 0.78rem;
  color: var(--muted);
  box-shadow: var(--shadow-sm);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent);
}

.hero h1 {
  margin-top: 1.1rem;
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
  max-width: 20ch;
}

.hero h1 .grad {
  display: inline-block;
  background: linear-gradient(100deg, var(--primary), var(--primary-2) 60%, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 1rem;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
  line-height: 1.65;
}

.search {
  margin-top: 1.75rem;
  width: min(620px, 100%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.55rem 0.4rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.search-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.55rem 0;
  font-size: 0.95rem;
  outline: none;
}

.search input::placeholder {
  color: var(--muted);
}

.search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-hint {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.4rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-family: inherit;
}

.stats {
  margin-top: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 108px;
  padding: 0.6rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-sm);
}

.stat strong {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------------- Tools section ---------------- */

.tools-section {
  padding-bottom: 1rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  margin-bottom: 0.25rem;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}

@supports (backdrop-filter: blur(10px)) {
  .toolbar {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.chips {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0.1rem;
  margin: -0.15rem -0.1rem;
  scrollbar-width: none;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.845rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.15s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.chip-count {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--ring);
}

.chip.active .chip-count {
  color: rgba(255, 255, 255, 0.8);
}

.toolbar-right {
  display: flex;
  gap: 0.5rem;
}

.select {
  position: relative;
}

.select::after {
  content: "▾";
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 0.7rem;
}

.select select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.5rem 1.9rem 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.845rem;
  cursor: pointer;
  max-width: 190px;
}

.select select:hover {
  border-color: var(--border-strong);
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0.9rem;
}

.results-count {
  font-size: 0.875rem;
  color: var(--muted);
}

.demo-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 100%;
}

.demo-banner strong {
  font-weight: 700;
}

.demo-banner .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------------- Cards ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1rem;
  padding-bottom: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: rise 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: min(calc(var(--i, 0) * 32ms), 320ms);
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  box-shadow: var(--shadow-md);
}

.card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.card-hit:focus-visible {
  outline: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 23px;
  line-height: 1;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  flex: none;
}

.tool-icon.lg {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  font-size: 27px;
}

.chip-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip-sm.warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-text);
}

.card-name {
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding-right: 0.25rem;
}

.card-tagline {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.free-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--success);
  font-weight: 700;
}

.free-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.card-cta {
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ---------------- Skeletons ---------------- */

.card-sk {
  animation: none;
  pointer-events: none;
}

.sk {
  border-radius: 7px;
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--border) 37%,
    var(--surface-2) 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.sk-line {
  height: 11px;
}

.sk-line.w40 {
  width: 40%;
}
.sk-line.w60 {
  width: 60%;
}
.sk-line.w70 {
  width: 70%;
}
.sk-line.w90 {
  width: 90%;
}

/* ---------------- States ---------------- */

.state {
  max-width: 560px;
  margin: 1rem auto 2.5rem;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  text-align: center;
}

.state-icon {
  font-size: 2rem;
  line-height: 1;
}

.state h3 {
  margin-top: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.state p {
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.state .btn {
  margin-top: 1.1rem;
}

.state-note {
  padding: 1rem 0 2rem;
  color: var(--muted);
  text-align: center;
}

/* ---------------- How it works ---------------- */

.how {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.how-head {
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
}

.how h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -0.025em;
  font-weight: 800;
}

.how-head p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 1.4rem 1.3rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.step h3 {
  margin-top: 0.35rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.step p {
  margin-top: 0.35rem;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.75rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.footer-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.footer-brand strong {
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-brand span {
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-links a {
  font-weight: 600;
}

/* ---------------- Modal ---------------- */

.modal {
  width: min(720px, calc(100vw - 2rem));
  max-width: 720px;
  max-height: min(88vh, 880px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 90px -30px rgba(2, 6, 23, 0.7);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(5, 9, 18, 0.6);
}

@supports (backdrop-filter: blur(6px)) {
  .modal::backdrop {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }
}

.modal[open] {
  animation: pop 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-scroll {
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.3rem 1.4rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.modal-title-wrap {
  min-width: 0;
  flex: 1;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.modal-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.modal-head .muted {
  margin-top: 0.3rem;
  font-size: 0.875rem;
}

.modal-close {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-inner {
  padding: 1.2rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.modal-inner h3 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.rich {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
}

.rich p + p,
.rich ul + p,
.rich p + ul {
  margin-top: 0.6rem;
}

.rich ul,
.rich ol {
  margin: 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rich li::marker {
  color: var(--primary);
}

.rich code {
  padding: 0.1rem 0.3rem;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.85em;
}

.rich strong {
  font-weight: 700;
}

.rich h4 {
  font-size: 0.95rem;
  margin: 0.6rem 0 0.3rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.fact {
  padding: 0.6rem 0.75rem;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 0;
}

.fact span {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fact strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.file-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.95rem;
}

.file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.file-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.file-meta {
  font-size: 0.73rem;
  color: var(--muted);
}

.file .btn {
  flex: none;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}

.modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  z-index: 120;
  transform: translate(-50%, 12px);
  max-width: min(440px, calc(100vw - 2rem));
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.83rem;
  line-height: 1.4;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- Animations ---------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 60px;
  }

  .container {
    width: calc(100% - 2rem);
  }

  .brand-text span {
    display: none;
  }

  .brand-text strong {
    font-size: 0.92rem;
  }

  .header-actions .btn-ghost {
    padding: 0.45rem 0.6rem;
    font-size: 0.8rem;
  }

  .hero {
    padding: 2.75rem 0 2rem;
  }

  .hero h1 {
    max-width: 16ch;
  }

  .search-hint {
    display: none;
  }

  .toolbar {
    position: static;
    padding-top: 0.4rem;
  }

  .toolbar-right {
    width: 100%;
  }

  .toolbar-right .select {
    flex: 1;
  }

  .toolbar-right .select select {
    width: 100%;
    max-width: none;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
  }

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

  .modal {
    width: calc(100vw - 1.2rem);
    max-height: 92vh;
    border-radius: 16px;
  }

  .modal-head {
    padding: 1rem 1rem 0.85rem;
  }

  .modal-inner {
    padding: 1rem 1rem 1.2rem;
    gap: 1.15rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .stat {
    min-width: 92px;
    padding: 0.5rem 0.8rem;
  }

  .file {
    flex-wrap: wrap;
  }

  .file .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
