/* ============================================================
   炽小阳工作台 — Modern Workbench Design System
   ============================================================ */

@font-face {
  font-family: "FusionPixel";
  src: url("../fonts/fusion-pixel-12px.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---- tokens ---- */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #171b21;
  --surface-hover: #1a1f25;
  --surface-raised: #1b2027;
  --border: #272d35;
  --border-subtle: #20252b;
  --border-card: #252b33;
  --border-strong: #2a3038;
  --text-primary: #f0f3f6;
  --text-secondary: #b0b7c0;
  --text-muted: #8b949e;
  --text-faint: #626b77;
  --accent: #55d875;
  --accent-hover: #66e184;
  --accent-icon: #57d675;
  --accent-muted: rgba(85, 216, 117, 0.11);
  --accent-border: rgba(74, 222, 128, 0.38);
  --accent-focus-ring: rgba(74, 222, 128, 0.1);
  --danger: #f07178;
  --warning: #e6c07b;
  --info: #61afef;
  --header-bg: rgba(16, 18, 22, 0.92);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.18);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --content-max: 1440px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-pixel: "FusionPixel", "Microsoft YaHei", sans-serif;
  --mono: Consolas, "Courier New", monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition: 0.18s ease;
  --transition-fast: 0.12s ease;
  --transition-normal: 0.2s ease;
  --selection-bg: var(--accent-muted);
  --selection-fg: var(--text-primary);
  --site-header-height: 72px;
  --category-nav-height: 52px;
  --scroll-anchor-offset: 90px;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-hover: #f0f1f4;
  --surface-raised: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-card: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --text-primary: #1a1d21;
  --text-secondary: #5f6368;
  --text-muted: #9aa0a6;
  --text-faint: #b0b7c0;
  --accent: #3baf44;
  --accent-hover: #329a3a;
  --accent-icon: #3baf44;
  --accent-muted: rgba(59, 175, 68, 0.1);
  --accent-border: rgba(59, 175, 68, 0.4);
  --accent-focus-ring: rgba(59, 175, 68, 0.12);
  --header-bg: rgba(255, 255, 255, 0.92);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* ---- base ---- */

* {
  box-sizing: border-box;
}

body.wb-theme {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body.wb-theme {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(85, 216, 117, 0.05), transparent 50%),
    var(--bg);
}

[data-theme="light"] body.wb-theme {
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(59, 175, 68, 0.04), transparent 50%),
    var(--bg);
}

::selection {
  background: var(--selection-bg);
  color: var(--selection-fg);
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.content-container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
}

html {
  scroll-behavior: smooth;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

/* ---- components: header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  min-height: 72px;
  box-sizing: border-box;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text-primary);
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  min-width: 0;
}

.brand:hover {
  background: var(--surface-hover);
}

.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brand-emblem {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: var(--surface-raised);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.brand:hover .brand-emblem {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: center top;
  image-rendering: pixelated;
  border-radius: 4px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-title-text {
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.header-link:hover {
  color: #e6edf3;
  background: var(--surface-hover);
}

.header-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.header-link-accent {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-muted);
}

.header-link-accent:hover {
  color: var(--accent-hover);
  background: var(--accent-muted);
  border-color: var(--accent-border);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--surface-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* ---- components: footer ---- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 14px 0;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  margin-top: auto;
}

.footer-lines {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.footer-line a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-line a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-sep {
  opacity: 0.45;
  user-select: none;
}

/* ---- components: buttons ---- */

.wb-btn,
.mc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.wb-btn:hover:not(:disabled),
.mc-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent-border);
}

.wb-btn:active:not(:disabled),
.mc-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.wb-btn.pressed,
.mc-btn.pressed {
  transform: scale(0.97);
  opacity: 0.88;
}

.wb-btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.wb-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(15, 17, 21, 0.25);
  border-top-color: #0f1115;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}

.wb-btn-primary.is-loading::after {
  border-color: rgba(15, 17, 21, 0.2);
  border-top-color: #0f1115;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

.wb-btn:disabled,
.mc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wb-btn-primary,
.mc-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1115;
}

.wb-btn-primary:hover:not(:disabled),
.mc-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.cancel-upload-btn {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.cancel-upload-btn:hover:not(:disabled) {
  background: rgba(240, 113, 120, 0.1);
}

/* ---- components: cards & surfaces ---- */

.wb-card,
.mc-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.wb-input-surface,
.mc-slot {
  background: var(--surface-hover);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), background var(--transition);
}

/* ---- components: search ---- */

.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-box:focus-within {
  border-color: #4ade80;
  box-shadow: 0 0 0 3px var(--accent-focus-ring);
}

.search-box:focus-within .search-box-icon {
  color: var(--accent);
}

.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-normal), background var(--transition-normal);
}

.search-clear:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.search-clear svg {
  width: 16px;
  height: 16px;
}

.header-link svg {
  width: 16px;
  height: 16px;
}

.search-box-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition-normal);
}

.search-box-icon svg {
  width: 20px;
  height: 20px;
}

.search-count {
  flex-shrink: 0;
  padding-right: 12px;
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  user-select: none;
}

.search-box.has-value .search-count {
  display: none;
}

.search-input {
  flex: 1;
  min-width: 0;
  min-height: 54px;
  padding: 14px 12px 14px 48px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* ---- components: category tabs ---- */

.category-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  overflow-x: visible;
  overflow-y: auto;
  scrollbar-width: none;
  background: transparent;
  border: none;
  -webkit-overflow-scrolling: touch;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
  text-align: center;
}

.category-tab:hover {
  color: #e6edf3;
  background: rgba(255, 255, 255, 0.04);
}

.category-tab.active {
  color: #62df80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.3);
}

.category-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- components: tool cards ---- */

.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 130px;
  padding: 14px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}

.tool-card:active {
  transform: translateY(0) scale(0.985);
  transition-duration: 0.1s;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  background: var(--surface-hover);
  box-shadow: var(--shadow-card-hover);
}

.tool-card:focus-visible {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-card-hover);
  outline: none;
}

.tool-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--accent-icon);
  flex-shrink: 0;
  background: var(--accent-muted);
  border-radius: 9px;
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
}

.tool-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tool-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-external .tool-card-title::after {
  content: "↗";
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.tool-card.is-hidden {
  display: none;
}

/* ---- main content ---- */

.main-content {
  flex: 1;
  width: 100%;
  padding: 0;
}

/* ---- home page ---- */

.home-page {
  padding: 40px 0 48px;
}

.home-layout {
  position: relative;
}

.home-main {
  min-width: 0;
}

.category-rail {
  z-index: 45;
}

.category-rail .category-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  margin: 0;
  background: rgba(23, 27, 33, 0.92);
  border: 1px solid #292f37;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

[data-theme="light"] .category-rail .category-nav {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--border-strong);
}

@media (min-width: 901px) {
  .content-container.home-page {
    padding-right: 0;
  }

  .category-rail {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: max(24px, env(safe-area-inset-right));
    width: 96px;
  }

  .category-rail .category-nav {
    max-height: calc(100vh - var(--site-header-height) - 40px);
    overflow-y: auto;
    scrollbar-width: none;
  }

  .category-rail .category-nav::-webkit-scrollbar {
    display: none;
  }
}

.home-hero {
  text-align: center;
  margin-bottom: 40px;
  padding-top: 4px;
}

.home-hero-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text-primary);
}

.home-hero-sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: #8b949e;
}

.home-section-title,
.group-label {
  position: relative;
  padding-left: 13px;
}

.home-section-title::before,
.group-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: #4ade80;
}

.home-section {
  margin-bottom: 40px;
}

.home-section-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-group {
  scroll-margin-top: var(--scroll-anchor-offset);
}

.tool-group + .tool-group {
  margin-top: 44px;
}

.group-label {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-subgroup + .tool-subgroup {
  margin-top: 28px;
}

.subgroup-label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 13px;
}

.search-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}

.search-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent);
}

.search-empty-icon svg {
  width: 40px;
  height: 40px;
  opacity: 0.75;
}

.search-empty p {
  margin: 0;
  font-size: 14px;
}

.search-empty-query {
  margin-bottom: 8px;
  color: var(--text-primary);
}

.search-empty-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.tool-processing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--accent-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

.tool-processing-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-icon);
  flex-shrink: 0;
}

.tool-processing-external {
  background: rgba(97, 175, 239, 0.1);
}

.tool-processing-external svg {
  color: var(--info);
}

.home-section.is-hidden,
.tool-group.is-hidden {
  display: none;
}

/* ---- tool page ---- */

.tool-page {
  padding: 24px 0 48px;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.tool-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
}

.tool-head-icon svg {
  width: 22px;
  height: 22px;
}

.tool-head-text {
  min-width: 0;
}

.tool-head h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.tool-head-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-normal), border-color var(--transition-normal), background var(--transition-normal);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

.back-link:hover {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--surface-hover);
}

.tool-body {
  padding: 24px;
}

.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  padding: 28px 20px;
  cursor: pointer;
  transition: background var(--transition-normal), border-color var(--transition-normal), border-style var(--transition-normal);
}

.file-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: var(--radius-sm);
  transition: transform var(--transition-normal), background var(--transition-normal);
}

.file-drop-icon svg {
  width: 22px;
  height: 22px;
}

.file-drop.dragover {
  background: var(--accent-muted);
  border-color: var(--accent);
  border-style: solid;
}

.file-drop.dragover .file-drop-icon {
  transform: scale(1.08);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  /* 避免透明 file input 拦截拖放（WebView2/Chrome 会显示禁止拖拽光标） */
  pointer-events: none;
}

.file-drop-label,
.upload-hint,
.file-list {
  position: relative;
  z-index: 2;
}

.file-drop-label {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

.upload-hint {
  margin: 10px 0 0;
  padding: 0;
  max-width: 100%;
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
  pointer-events: none;
}

.upload-hint-line {
  display: block;
}

.upload-hint-note {
  color: var(--warning);
  font-weight: 600;
}

.upload-hint-offline a {
  pointer-events: auto;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.upload-hint-offline a:hover {
  text-decoration: underline;
}

.upload-hint-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.upload-hint-error.hidden {
  display: none;
}

.file-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  width: 100%;
}

.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.file-list-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  transition: color var(--transition), background var(--transition);
}

.file-list-remove:hover {
  color: var(--danger);
  background: rgba(240, 113, 120, 0.1);
  border-color: var(--danger);
}

.file-drop.file-drop-busy {
  pointer-events: none;
  opacity: 0.65;
}

.file-drop.has-files .file-drop-label {
  font-size: 12px;
}

.options-block:not(:has(.preset-bar)):not(:has(.field)) {
  display: none;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.preset-chip {
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.preset-chip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.preset-chip.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-muted);
}

.preset-option-fields:empty {
  display: none;
}

.preset-option-fields {
  margin-bottom: 4px;
}

.preset-bar + .preset-option-fields:not(:empty),
.preset-bar + .advanced-fields:not(.advanced-hidden) {
  margin-top: 0;
}

.advanced-fields.advanced-hidden {
  display: none;
}

.advanced-fields {
  margin-top: 4px;
}

.options-block:not(:has(.field)) .advanced-fields:not(.advanced-hidden) {
  display: none;
}

.options-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.field {
  margin-top: 14px;
}

.field:first-child {
  margin-top: 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.field input,
.field select {
  display: block;
  width: 100%;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field select {
  padding-right: 32px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa0a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  cursor: pointer;
}

[data-theme="light"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.field input:focus,
.field select:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.field input[type="checkbox"],
.field input[type="radio"] {
  display: inline-block;
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.field input[type="checkbox"]:focus,
.field input[type="radio"]:focus {
  border-color: transparent;
  box-shadow: none;
}

.field label:has(> input[type="checkbox"]),
.field label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}

.field-row .field.field-check {
  flex: 0 0 auto;
  align-self: flex-end;
  min-width: 0;
  padding-bottom: 10px;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.field-row .field {
  flex: 1;
  min-width: 140px;
  margin-top: 0;
}

.field-row + .field-row {
  margin-top: 14px;
}

.field-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.wb-dialog {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  max-width: min(420px, calc(100vw - 32px));
  width: 100%;
}

.wb-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.wb-dialog-body {
  padding: 24px;
}

.wb-dialog-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.wb-dialog-body .field:first-of-type {
  margin-top: 0;
}

.wb-dialog-error {
  color: var(--danger, #e5484d);
}

.wb-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.form-actions {
  margin-top: 24px;
}

/* ---- job progress ---- */

.job-panel {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
}

.job-panel.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: fadeSlideIn 0.25s var(--ease-out);
}

.job-phase-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.job-phase-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.job-phase-badge.phase-uploading {
  border-color: rgba(97, 175, 239, 0.4);
  background: rgba(97, 175, 239, 0.12);
  color: var(--info);
}

.job-phase-badge.phase-processing {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--accent);
  animation: job-phase-pulse 1.8s ease-in-out infinite;
}

.job-phase-badge.phase-done {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--accent);
}

.job-phase-badge.phase-error,
.job-phase-badge.phase-cancelled {
  border-color: rgba(240, 113, 120, 0.4);
  background: rgba(240, 113, 120, 0.1);
  color: var(--danger);
}

.job-phase-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.job-progress-track {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wb-progress,
.mc-progress {
  flex: 1;
  height: 8px;
  background: var(--surface-hover);
  border-radius: 999px;
  overflow: hidden;
  border: none;
}

.job-progress-track .wb-progress,
.job-progress-track .mc-progress {
  flex: 1;
}

.wb-progress-fill,
.mc-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s var(--ease-out);
}

.job-progress-bar.phase-processing .wb-progress-fill,
.job-progress-bar.phase-processing .mc-progress-fill {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent-hover) 50%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  animation: progress-shimmer 1.5s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-progress-bar.phase-done .wb-progress-fill,
.job-progress-bar.phase-done .mc-progress-fill {
  background: var(--accent);
}

.job-progress-bar.phase-error .wb-progress-fill,
.job-progress-bar.phase-error .mc-progress-fill {
  background: var(--danger);
}

.job-progress-percent {
  flex-shrink: 0;
  min-width: 48px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: var(--text-primary);
}

@keyframes job-phase-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

.job-status {
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 1.2em;
}

.job-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.upload-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 1.2em;
}

/* ---- preview ---- */

.preview-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.preview-title,
.share-result-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-item + .preview-item {
  margin-top: 4px;
}

.preview-file-name {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.preview-media {
  padding: 12px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  overflow: auto;
}

.preview-media img,
.preview-gallery img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.preview-media video,
.preview-media audio {
  display: block;
  width: 100%;
  max-width: 100%;
}

.preview-pdf {
  width: 100%;
  min-height: 480px;
  border: 0;
  background: #fff;
  border-radius: var(--radius-sm);
}

.preview-pdf-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #fff;
  border-radius: var(--radius-sm);
}

.preview-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.preview-text {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  padding: 12px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.preview-gallery-item {
  padding: 8px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}

.preview-gallery-item figcaption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- share (legacy) ---- */

.share-intro {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.share-domain {
  color: var(--accent);
  background: var(--accent-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

.share-result {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.share-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.share-link-item {
  padding: 14px;
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
}

.share-link-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.share-link-name {
  font-weight: 600;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.share-link-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  color: var(--text-primary);
}

.share-copy-btn,
.share-open-btn {
  padding: 8px 14px;
  font-size: 12px;
  white-space: nowrap;
}

/* ---- legal & static pages ---- */

.legal-page,
.about-page,
.error-page {
  padding: 32px 0 48px;
}

.legal-head,
.about-head,
.error-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.legal-head h1,
.about-head h1,
.error-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}

.legal-body,
.about-body {
  padding: 28px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.75;
}

.legal-body h2,
.about-body h2 {
  margin: 24px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.legal-body ul,
.about-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.legal-body li,
.about-body li {
  margin: 6px 0;
}

.legal-body a,
.about-body a {
  color: var(--accent);
  text-decoration: none;
}

.legal-body a:hover,
.about-body a:hover {
  text-decoration: underline;
}

.legal-updated {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.legal-related {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.error-page {
  text-align: center;
}

/* ---- offline download page (clarity-focused) ---- */

.page-offline-download {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-offline-download .site-header,
.page-offline-download .site-footer {
  display: none;
}

.page-offline-download .main-content {
  padding: 0;
}

.page-offline-download .page-wrap {
  min-height: 100vh;
}

.offline-landing {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  color: #eef2f8;
  background: #0a1220;
  --offline-mx: 0;
  --offline-my: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.offline-particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.offline-landing.has-interactive-bg .offline-grid {
  opacity: 0;
}

.offline-landing-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.offline-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  transition: transform 0.3s ease-out;
  transform: translate(calc(var(--offline-mx) * 8px), calc(var(--offline-my) * 6px));
}

.offline-blob-a {
  top: -10%;
  right: -2%;
  width: min(48vw, 520px);
  height: min(48vw, 520px);
  background: rgba(235, 220, 188, 0.16);
  animation: offlineBlobDrift 28s ease-in-out infinite alternate;
}

.offline-blob-b {
  top: 30%;
  right: 20%;
  width: min(30vw, 320px);
  height: min(30vw, 320px);
  background: rgba(180, 200, 255, 0.1);
  animation: offlineBlobDrift 24s ease-in-out infinite alternate-reverse;
}

.offline-blob-c {
  bottom: -14%;
  left: -8%;
  width: min(42vw, 440px);
  height: min(42vw, 440px);
  background: rgba(100, 140, 220, 0.12);
  animation: offlineBlobDrift 32s ease-in-out infinite alternate;
  animation-delay: -8s;
}

.offline-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 25%, transparent 85%);
  transition: opacity 0.4s ease;
}

.offline-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, transparent 40%, rgba(6, 10, 18, 0.55) 100%);
}

@keyframes offlineBlobDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(12px, -12px, 0) scale(1.03); }
}

@keyframes offlineFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-animate="up"] {
  animation: offlineFadeUp 0.7s var(--ease-out) both;
  animation-delay: var(--animate-delay, 0s);
}

[data-animate="fade"] {
  animation: offlineFadeUp 0.5s ease both;
}

/* minimal top nav */
.offline-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 18px clamp(20px, 4vw, 40px);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  --scroll-progress: 0;
}

.offline-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: calc(var(--scroll-progress) * 100%);
  background: linear-gradient(90deg, rgba(140, 200, 255, 0.9), rgba(200, 220, 255, 0.6));
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

.offline-nav.is-scrolled {
  background: rgba(10, 16, 28, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.offline-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.offline-nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
}

.offline-nav-name {
  font-size: 15px;
  font-weight: 600;
  color: #f4f7fb;
  letter-spacing: -0.01em;
}

.offline-nav-badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(240, 244, 248, 0.82);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.offline-nav-actions-wrap {
  flex: 1;
  min-width: 0;
}

.offline-nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.offline-nav-link {
  position: relative;
  font-size: 13px;
  color: rgba(220, 228, 240, 0.72);
  text-decoration: none;
  transition: color var(--transition);
}

.offline-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 1px;
  background: rgba(200, 220, 255, 0.75);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s var(--ease-out);
}

.offline-nav-link:hover {
  color: #f4f7fb;
}

.offline-nav-link:hover::after,
.offline-nav-link:focus-visible::after {
  transform: scaleX(1);
}

.offline-nav-link:focus-visible,
.offline-btn:focus-visible,
.offline-window-tab:focus-visible,
.offline-window-copy:focus-visible,
.offline-window-copy-sm:focus-visible,
.offline-window-download:focus-visible {
  outline: 2px solid rgba(140, 200, 255, 0.85);
  outline-offset: 2px;
}

/* hero */
.offline-hero {
  position: relative;
  z-index: 2;
  padding: clamp(32px, 6vh, 64px) clamp(20px, 4vw, 40px) clamp(48px, 7vh, 80px);
}

.offline-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.offline-download-section {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.offline-download-section .offline-window {
  margin: 0;
}

.offline-download-kicker {
  margin: 16px 0 0;
  text-align: left;
}

.offline-kicker {
  margin: 0 0 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 228, 240, 0.55);
}

.offline-kicker-line {
  display: block;
}

.offline-kicker-meta {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(220, 228, 240, 0.42);
}

.offline-title {
  margin: 0 0 24px;
  font-size: clamp(42px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 0.06em;
}

.offline-title-line {
  display: block;
  animation: offlineFadeUp 0.7s var(--ease-out) both;
}

.offline-title-line:nth-child(2) {
  animation-delay: 0.08s;
}

.offline-title-accent {
  background: linear-gradient(
    105deg,
    #fafbfc 0%,
    #fafbfc 40%,
    rgba(180, 210, 255, 0.95) 50%,
    #fafbfc 60%,
    #fafbfc 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: offlineTitleShimmer 8s ease-in-out infinite;
  animation-delay: 0.08s;
}

@keyframes offlineTitleShimmer {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

.offline-desc {
  margin: 0 0 14px;
  max-width: 36em;
  font-size: 16px;
  line-height: 1.75;
  color: rgba(232, 237, 244, 0.78);
}

.offline-desc-sub {
  margin-bottom: 32px;
  font-size: 15px;
  color: rgba(220, 228, 240, 0.58);
}

.offline-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.offline-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid transparent;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast), background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.offline-btn svg {
  width: 16px;
  height: 16px;
}

.offline-btn-primary {
  color: #0a1220;
  background: #fff;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
}

.offline-btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  pointer-events: none;
}

.offline-btn-primary:hover::after {
  animation: offlineBtnShine 0.65s ease;
}

@keyframes offlineBtnShine {
  to { transform: translateX(120%); }
}

.offline-btn-primary:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.offline-btn-ghost {
  color: rgba(240, 244, 248, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
}

.offline-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* terminal window */
.offline-window {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(12, 18, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 24px 64px rgba(0, 0, 0, 0.4);
  animation: offlineWindowFloat 7s ease-in-out infinite;
}

@keyframes offlineWindowFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.offline-window-chrome {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.offline-window-dots {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.offline-window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.offline-window-dots i:nth-child(1) { background: #ff5f57; }
.offline-window-dots i:nth-child(2) { background: #febc2e; }
.offline-window-dots i:nth-child(3) { background: #28c840; }

.offline-window-tabs-wrap {
  flex: 1;
  min-width: 0;
}

.offline-window-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.offline-window-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(220, 228, 240, 0.55);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.offline-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tab-brand, rgba(255, 255, 255, 0.4));
  opacity: 0.55;
  transition: opacity var(--transition), box-shadow var(--transition), transform var(--transition);
}

.offline-window-tab.is-active .offline-tab-dot {
  opacity: 1;
  box-shadow: 0 0 8px color-mix(in srgb, var(--tab-brand, #fff) 55%, transparent);
  transform: scale(1.15);
}

.offline-window-tab:hover {
  color: rgba(240, 244, 248, 0.88);
}

.offline-window-tab.is-active {
  color: #f4f7fb;
}

.offline-window-tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: calc(100% - 2px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: transform 0.22s var(--ease-out), width 0.22s var(--ease-out);
  pointer-events: none;
}

.offline-window-panels {
  position: relative;
}

.offline-window-panel {
  position: relative;
  padding: 20px 22px 24px;
}

.offline-window-panel.is-active {
  animation: offlinePanelIn 0.22s ease both;
}

@keyframes offlinePanelIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.offline-window-panel.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tab-brand, rgba(140, 180, 255, 0.8)), transparent);
  opacity: 0.85;
}

.offline-window-panel[hidden] {
  display: none;
}

.offline-window-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.offline-window-label {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(220, 228, 240, 0.65);
}

.offline-window-copy,
.offline-window-copy-sm {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  padding: 5px 12px;
  font-size: 12px;
  color: rgba(220, 228, 240, 0.72);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.offline-window-copy svg,
.offline-window-copy-sm svg {
  width: 13px;
  height: 13px;
}

.offline-window-copy:hover,
.offline-window-copy-sm:hover {
  color: #f4f7fb;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.offline-window-copy.is-copied,
.offline-window-copy-sm.is-copied {
  border-color: rgba(120, 220, 160, 0.45);
  color: #9cf0b0;
  animation: offlineCopyRipple 0.45s ease;
}

@keyframes offlineCopyRipple {
  0% { box-shadow: 0 0 0 0 rgba(120, 220, 160, 0.35); }
  100% { box-shadow: 0 0 0 8px rgba(120, 220, 160, 0); }
}

.offline-window-code {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0 10px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #060a14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.offline-window-prompt {
  font-family: var(--mono);
  font-size: 14px;
  color: rgba(140, 180, 240, 0.75);
  user-select: none;
}

.offline-window-url {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
  color: #e8edf4;
}

.offline-window-extract {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(220, 228, 240, 0.58);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
}

.offline-window-extract code {
  flex: 1;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #e8dcc0;
}

.offline-window-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #0a1220;
  text-decoration: none;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--transition-fast), background var(--transition), box-shadow var(--transition);
}

.offline-window-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.offline-window-download svg {
  width: 15px;
  height: 15px;
}

/* guide section */
.offline-guide {
  position: relative;
  z-index: 2;
  padding: 0 clamp(20px, 4vw, 40px) 80px;
}

.offline-guide-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 228, 240, 0.48);
}

.offline-guide-title {
  margin: 0 0 28px;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f4f7fb;
  opacity: 0;
  transform: translateY(20px);
}

.offline-guide-title.is-revealed {
  animation: offlineFadeUp 0.7s var(--ease-out) both;
}

.offline-guide-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.offline-guide-grid::before {
  content: "";
  position: absolute;
  top: 38px;
  left: 12%;
  right: 12%;
  height: 1px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.offline-guide-card {
  position: relative;
  padding: 24px 22px;
  background: rgba(16, 22, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color var(--transition), transform var(--transition-fast);
  opacity: 0;
  transform: translateY(20px);
  overflow: hidden;
}

.offline-guide-card.is-revealed {
  animation: offlineFadeUp 0.7s var(--ease-out) both;
  animation-delay: var(--animate-delay, 0s);
}

.offline-guide-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.offline-guide-card:hover::after {
  opacity: 1;
}

.offline-guide-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.offline-guide-card:hover .offline-guide-num {
  color: rgba(180, 210, 255, 0.72);
}

.offline-guide-num {
  display: block;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(220, 228, 240, 0.42);
  transition: color var(--transition);
}

.offline-guide-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #f0f4f8;
}

.offline-guide-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(220, 228, 240, 0.58);
}

.offline-guide-card strong {
  color: rgba(232, 237, 244, 0.82);
  font-weight: 600;
}

.offline-guide-card code {
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: #e8dcc0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.offline-guide-note {
  margin: 0;
  font-size: 13px;
  color: rgba(220, 228, 240, 0.52);
}

.offline-guide-note a {
  color: rgba(180, 210, 255, 0.92);
  text-decoration: none;
}

.offline-guide-note a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .offline-blob {
    animation: none;
    transform: none;
    transition: none;
  }

  [data-animate="up"],
  [data-animate="fade"] {
    animation: none;
  }

  .offline-title-line,
  .offline-title-accent {
    animation: none;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #fafbfc;
  }

  .offline-btn-primary::after {
    display: none;
  }

  .offline-window {
    animation: none;
  }

  .offline-window-tab-indicator {
    transition: none;
  }

  .offline-window-panel {
    animation: none;
  }

  .offline-guide-title,
  .offline-guide-card {
    opacity: 1;
    transform: none;
  }

  .offline-guide-title.is-revealed,
  .offline-guide-card.is-revealed {
    animation: none;
  }
}

.error-pixel {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 16px;
  line-height: 1;
  animation: error-pixel-pulse 2.5s ease-in-out infinite;
}

@keyframes error-pixel-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.72;
  }
}

html.theme-transitioning,
html.theme-transitioning body.wb-theme,
html.theme-transitioning .site-header,
html.theme-transitioning .site-footer,
html.theme-transitioning .wb-card,
html.theme-transitioning .tool-card,
html.theme-transitioning .category-nav,
html.theme-transitioning .wb-input-surface,
html.theme-transitioning .search-input,
html.theme-transitioning .preset-chip,
html.theme-transitioning .header-link,
html.theme-transitioning .theme-toggle {
  transition:
    background-color 0.2s var(--ease-out),
    color 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out) !important;
}

.error-message {
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-secondary);
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ---- responsive ---- */

@media (max-width: 768px) {
  .content-container,
  .content-container.home-page {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }

  .content-container.home-page {
    display: flex;
    flex-direction: column;
  }

  .home-hero {
    order: 1;
    margin-bottom: 20px;
  }

  .category-rail {
    order: 2;
  }

  .home-section[data-section="popular"] {
    order: 3;
  }

  .home-main {
    order: 4;
  }

  .site-header-inner {
    padding: 10px 0;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 56px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
    overflow: hidden;
  }

  .brand-emblem {
    width: 36px;
    height: 36px;
    padding: 3px;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .brand-copy {
    flex: 1;
    min-width: 0;
  }

  .brand-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    line-height: 1.25;
  }

  .brand-tagline {
    display: none;
  }

  .header-actions {
    gap: 4px;
    flex-shrink: 0;
  }

  .header-link {
    min-width: 40px;
    min-height: 40px;
    justify-content: center;
    padding: 8px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .header-link span.link-label {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .category-rail {
    position: sticky;
    top: var(--site-header-height);
    z-index: 50;
    width: auto;
    margin-bottom: 16px;
    margin-left: calc(-1 * max(20px, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(20px, env(safe-area-inset-right)));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }

  .category-rail .category-nav {
    flex-direction: row;
    gap: 8px;
    padding: 10px 0;
    margin: 0;
    max-height: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-padding-inline: max(20px, env(safe-area-inset-left));
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-rail .category-nav::-webkit-scrollbar {
    display: none;
  }

  .category-tab {
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    scroll-snap-align: start;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .tool-group {
    scroll-margin-top: calc(var(--site-header-height) + var(--category-nav-height) + 8px);
  }

  .home-page {
    padding: 16px 0 max(32px, env(safe-area-inset-bottom));
  }

  .home-hero-title {
    font-size: clamp(20px, 5.2vw, 24px);
    line-height: 1.35;
  }

  .home-hero-sub {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .search-box {
    touch-action: manipulation;
  }

  .search-count {
    display: none;
  }

  .search-input {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 44px 12px 48px;
  }

  .search-clear {
    width: 40px;
    height: 40px;
    right: 6px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .home-section {
    margin-bottom: 28px;
  }

  .home-section-title,
  .group-label {
    font-size: 16px;
    margin-bottom: 12px;
  }

  .tool-group + .tool-group {
    margin-top: 32px;
  }

  .tool-card-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-card {
    flex-direction: row;
    align-items: flex-start;
    min-height: auto;
    gap: 12px;
    padding: 14px 16px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .tool-card-icon {
    width: 40px;
    height: 40px;
    margin-top: 0;
    flex-shrink: 0;
  }

  .tool-card-icon svg {
    width: 22px;
    height: 22px;
  }

  .tool-card-title {
    font-size: 15px;
  }

  .tool-card-desc {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .search-empty {
    padding: 32px 16px;
  }

  .tool-page {
    padding: 16px 0 40px;
  }

  .tool-body {
    padding: 16px;
  }

  .legal-body,
  .about-body {
    padding: 16px;
  }

  .legal-page,
  .about-page,
  .error-page {
    padding: 20px 0 40px;
  }

  .offline-hero {
    padding-top: 24px;
    padding-bottom: 28px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .offline-hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .offline-download-kicker {
    margin-top: 16px;
  }

  .offline-window {
    animation: none;
    border-radius: 14px;
  }

  .offline-particles-canvas {
    display: none;
  }

  .offline-blob {
    animation-duration: 36s;
    filter: blur(56px);
  }

  .offline-nav {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 12px;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  }

  .offline-nav-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .offline-nav-name {
    font-size: 14px;
  }

  .offline-nav-actions-wrap {
    flex: 1 1 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -4px;
    padding: 0 4px 2px;
  }

  .offline-nav-actions-wrap::-webkit-scrollbar {
    display: none;
  }

  .offline-nav-actions {
    gap: 6px 18px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 2px;
  }

  .offline-nav-link {
    flex-shrink: 0;
    padding: 6px 0;
    font-size: 13px;
  }

  .offline-kicker {
    margin-bottom: 14px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  .offline-kicker-meta {
    font-size: 10px;
  }

  .offline-title {
    font-size: clamp(32px, 8.5vw, 42px);
    margin-bottom: 16px;
  }

  .offline-desc {
    font-size: 15px;
    line-height: 1.65;
    max-width: none;
  }

  .offline-desc-sub {
    font-size: 14px;
    margin-bottom: 22px;
  }

  .offline-cta-row {
    flex-direction: column;
    gap: 8px;
  }

  .offline-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding: 12px 20px;
  }

  .offline-window-chrome {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .offline-window-dots {
    display: none;
  }

  .offline-window-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -2px;
    padding: 0 2px;
  }

  .offline-window-tabs-wrap::-webkit-scrollbar {
    display: none;
  }

  .offline-window-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    width: max-content;
    min-width: 100%;
  }

  .offline-window-tab {
    flex-shrink: 0;
    padding: 8px 14px;
    min-height: 36px;
  }

  .offline-window-tab-indicator {
    display: none;
  }

  .offline-window-tab.is-active {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .offline-window-panel {
    padding: 16px;
  }

  .offline-window-panel-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }

  .offline-window-copy {
    align-self: flex-start;
    min-height: 36px;
    padding: 8px 14px;
  }

  .offline-window-code {
    padding: 12px 14px;
    margin-bottom: 12px;
  }

  .offline-window-url {
    font-size: 12px;
    line-height: 1.55;
  }

  .offline-window-extract {
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
  }

  .offline-window-copy-sm {
    min-height: 32px;
    padding: 6px 12px;
  }

  .offline-window-download {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    box-sizing: border-box;
  }

  .offline-guide {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(48px, calc(env(safe-area-inset-bottom, 0px) + 40px));
    padding-top: 8px;
  }

  .offline-guide-title {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .offline-guide-card {
    padding: 20px 18px;
  }

  .offline-guide-card h3 {
    font-size: 15px;
  }

  .offline-guide-card p {
    font-size: 14px;
    line-height: 1.65;
  }

  .offline-guide-note {
    font-size: 13px;
    line-height: 1.65;
  }

  .offline-guide-grid {
    grid-template-columns: 1fr;
  }

  .offline-guide-grid::before {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand-emblem {
    width: 34px;
    height: 34px;
  }

  .brand-logo {
    width: 26px;
    height: 26px;
  }

  .brand-title-text {
    font-size: 15px;
  }

  .home-page {
    padding: 14px 0 28px;
  }

  .home-hero-title {
    font-size: 18px;
  }

  .footer-line {
    font-size: 11px;
    gap: 4px 8px;
  }

  .tool-head-icon {
    display: none;
  }

  .tool-head h1 {
    font-size: 18px;
  }

  .form-actions .wb-btn,
  .form-actions .mc-btn {
    width: 100%;
  }

  .job-panel-actions {
    flex-direction: column;
  }

  .job-panel-actions .wb-btn,
  .job-panel-actions .mc-btn {
    width: 100%;
  }

  .job-progress-track {
    flex-wrap: wrap;
  }

  .job-progress-percent {
    width: 100%;
    text-align: left;
    margin-top: 4px;
  }

  .field-row .field {
    min-width: 100%;
  }

  .preview-gallery {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .error-actions .wb-btn {
    width: 100%;
  }

  .tool-card:active {
    transform: none;
  }

  .share-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .share-copy-btn,
  .share-open-btn {
    width: 100%;
    text-align: center;
  }

  .offline-nav-name {
    max-width: 9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .offline-nav-badge {
    padding: 2px 8px;
    font-size: 10px;
  }

  .offline-title {
    font-size: 30px;
  }
}

@media (max-width: 360px) {
  .home-hero-title {
    font-size: 17px;
  }

  .tool-card {
    padding: 12px 14px;
  }

  .tool-card-icon {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .tool-card:active {
    transform: none;
  }

  html.theme-transitioning,
  html.theme-transitioning * {
    transition: none !important;
  }
}
