:root {
  color-scheme: dark;
  --bg: #0b1017;
  --surface: #101722;
  --surface-strong: #131d2a;
  --surface-soft: #0d141d;
  --border: #202b39;
  --border-strong: #2f4157;
  --text-primary: #e8eef5;
  --text-secondary: #b5c2d2;
  --text-muted: #8396aa;
  --text-dim: #66788d;
  --accent: #79b8ff;
  --accent-strong: #d4e9ff;
  --accent-soft: rgba(121, 184, 255, 0.12);
  --accent-warm: #c8a06a;
  --success: #9eddaa;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --content-width: 1120px;
  --ui-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --mono-font: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui-font);
  color: var(--text-primary);
  background: var(--bg);
}

a {
  color: inherit;
}

code,
pre {
  font-family: var(--mono-font);
}

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

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.2;
}

.app-shell {
  width: min(calc(100% - 1.5rem), var(--content-width));
  margin: 0 auto;
  padding: 1.25rem 0 1.75rem;
}

.hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  background-image: radial-gradient(circle, rgba(121, 184, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 0.75rem;
}

.eyebrow,
.section-label {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.help-wrap {
  position: relative;
  flex-shrink: 0;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.help-btn:hover,
.help-btn[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.shortcuts-tooltip {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  min-width: 230px;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: none;
  gap: 0.5rem;
}

.shortcuts-tooltip.is-open {
  display: grid;
}

@media (hover: hover) and (pointer: fine) {
  .help-wrap:hover .shortcuts-tooltip {
    display: grid;
  }
}

.shortcuts-title {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.shortcut-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: right;
}

.brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(121, 184, 255, 0.38);
  background: linear-gradient(135deg, rgba(121, 184, 255, 0.18), rgba(121, 184, 255, 0.06));
  color: var(--accent-strong);
  font-family: var(--mono-font);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: box-shadow 0.22s ease, transform 0.18s ease, border-color 0.22s ease;
}

.brand:hover .brand-monogram {
  border-color: rgba(121, 184, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.14), 0 0 18px rgba(121, 184, 255, 0.18);
  transform: scale(1.07);
}

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

.brand-word-dim {
  color: var(--text-muted);
}

.brand-word-accent {
  background: linear-gradient(100deg, #e8f4ff 0%, #79b8ff 60%, #7ae0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-word-accent::after {
  content: "▌";
  -webkit-text-fill-color: var(--accent);
  color: var(--accent);
  font-size: 0.9em;
  margin-left: 0.05em;
  animation: cursor-blink 1.1s step-start infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.hero-copy {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: nowrap;
}

.meta-chip + .meta-chip::before {
  content: "\00b7";
  margin-right: 0.75rem;
  color: var(--text-dim);
}

.hero-panel {
  padding-top: 0.8rem;
}

.panel-heading {
  margin-bottom: 0.75rem;
}

.secure-panel {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.secure-panel-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0;
  cursor: pointer;
  list-style: none;
}

.secure-panel-toggle::-webkit-details-marker {
  display: none;
}

.secure-panel-toggle::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.secure-panel[open] > .secure-panel-toggle::after {
  transform: rotate(180deg);
}

.secure-panel-hint {
  display: none;
  color: var(--text-dim);
  font-size: 0.8rem;
  opacity: 0.68;
}

.secure-panel[open] .secure-panel-hint {
  display: inline-flex;
}

.secure-category-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.secure-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  padding: 0.85rem;
}

.secure-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.secure-card-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
}

.secure-card-meta {
  margin: 0.28rem 0 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.secure-card-copy {
  margin: 0.7rem 0 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.secure-badge.is-unlocked {
  border-color: rgba(158, 221, 170, 0.4);
  color: #ccebd2;
  background: rgba(158, 221, 170, 0.08);
}

.secure-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.password-field {
  display: grid;
  gap: 0.42rem;
}

.password-field span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.secure-input,
.secure-submit {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
}

.secure-input {
  min-height: 2.75rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.secure-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.14);
}

.secure-submit {
  align-self: end;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.secure-submit:hover {
  border-color: var(--accent);
  background: #141e2b;
}

.secure-status {
  margin: 0.7rem 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.secure-status.is-error {
  color: #f3b0b0;
}

.secure-status.is-success {
  color: #bfe3c8;
}

.panel-heading {
  margin-bottom: 0.5rem;
}

.search-panel {
  display: block;
  color: var(--text-secondary);
}

.search-input {
  width: 100%;
  min-height: 3rem;
  padding: 0.72rem 0.92rem;
  border-radius: calc(var(--radius-md) + 2px);
  border: 1px solid rgba(121, 184, 255, 0.28);
  outline: none;
  background: #111b28;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.45;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.search-input::placeholder {
  color: #8ea3b9;
}

.search-input:hover {
  border-color: rgba(121, 184, 255, 0.38);
  background: #132031;
}

.search-input:focus {
  border-color: rgba(121, 184, 255, 0.55);
  background: #152336;
  box-shadow:
    0 0 0 3px rgba(121, 184, 255, 0.12),
    0 18px 38px rgba(0, 0, 0, 0.16);
}

.search-input:focus-visible,
.secure-input:focus-visible,
.ghost-button:focus-visible,
.filter-pill:focus-visible,
.copy-button:focus-visible,
.secure-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.16);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.12rem;
}

.filter-bar-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.picker-wrap {
  position: relative;
  flex-shrink: 0;
}

.category-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.category-picker-btn:hover,
.category-picker-btn.is-open {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text-primary);
}

.category-picker-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.category-picker {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 50;
  min-width: 280px;
  max-height: 480px;
  overflow-y: auto;
  padding: 0.55rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-strong);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.category-picker[hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .category-picker:not([hidden]) {
    animation: picker-in 0.18s cubic-bezier(0.2, 0, 0, 1) both;
    transform-origin: top right;
  }

  .category-picker.expand-right:not([hidden]) {
    transform-origin: top left;
  }
}

@keyframes picker-in {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(-6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.picker-search-wrap {
  padding-bottom: 0.45rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
}

.picker-search {
  width: 100%;
  padding: 0.42rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.83rem;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.picker-search::placeholder {
  color: var(--text-dim);
}

.picker-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.12);
}

.picker-groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: start;
  column-gap: 0.3rem;
  row-gap: 0.4rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border);
}

.picker-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.picker-group-label {
  padding: 0.25rem 0.6rem 0.1rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  user-select: none;
}

.picker-empty {
  padding: 0.8rem 0.6rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.sticky-search-bar {
  position: fixed;
  top: 0.85rem;
  left: 50%;
  z-index: 35;
  width: min(calc(100% - 1.5rem), 960px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.sticky-search-bar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sticky-search-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 184, 255, 0.22);
  background: rgba(16, 23, 34, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.sticky-search-input-wrap {
  min-width: 0;
}

.search-input-sticky {
  min-height: 2.5rem;
  padding: 0.56rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  background: rgba(11, 17, 24, 0.9);
}

.sticky-active-category {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.48rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.sticky-clear-btn {
  min-height: 2.5rem;
  padding-inline: 0.9rem;
}

.picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.83rem;
  text-align: left;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.picker-item:hover {
  background: rgba(121, 184, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(121, 184, 255, 0.14);
}

.picker-item.is-active {
  background: var(--accent-soft);
  border-color: rgba(121, 184, 255, 0.28);
  color: var(--text-primary);
}

.picker-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-item-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.picker-item.is-active .picker-item-count {
  color: var(--text-muted);
}

.filter-bar-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 3rem;
  height: calc(100% - 0.3rem);
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
}

.filter-bar {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.3rem;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.ghost-button,
.filter-pill,
.copy-button {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.12s ease;
}

.ghost-button:hover,
.filter-pill:hover,
.copy-button:hover {
  border-color: var(--accent);
  background: #141e2b;
  color: var(--text-primary);
}

.ghost-button {
  padding: 0.55rem 0.9rem;
  font-size: 0.84rem;
}

.filter-pill {
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 0.2rem;
  padding: 0.32rem 0.65rem;
  font-size: 0.84rem;
}

.filter-pill.is-active {
  border-width: 1px;
  border-color: var(--accent);
  background: rgba(121, 184, 255, 0.16);
  color: var(--text-primary);
}

.filter-pill-pinned {
  color: var(--accent-warm);
  border-color: rgba(200, 160, 106, 0.35);
}

.filter-pill-pinned.is-active {
  border-color: var(--accent-warm);
  background: rgba(200, 160, 106, 0.14);
  color: var(--accent-warm);
}

.pin-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  padding: 0 0.25em;
  border-radius: 999px;
  background: rgba(200, 160, 106, 0.2);
  font-size: 0.75em;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 0.15em;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.active-state {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.result-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.layout {
  margin-top: 1rem;
}

.results-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 1rem;
}

.results-section + .results-section {
  margin-top: 0.9rem;
}

.results-section-protected {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, rgba(121, 184, 255, 0.06), rgba(16, 23, 34, 1) 28%);
}

.pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.pagination-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.pagination-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.pagination-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.12s ease;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(121, 184, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.pagination-button.is-active,
.pagination-button[aria-current="page"] {
  border-color: var(--accent);
  background: rgba(121, 184, 255, 0.16);
  color: var(--text-primary);
}

.pagination-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.pagination-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.16);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.section-caption {
  display: none;
}

.section-header h2 {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.results-section-protected .section-header h2 {
  color: var(--text-muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 0.75rem;
  align-items: start;
}

.command-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.95rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 3px 0 0 0 var(--category-accent-border, rgba(121, 184, 255, 0.24));
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  cursor: pointer;
  user-select: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.command-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-strong);
  transform: translateY(-1px);
}

.command-card:active {
  transform: translateY(0) scale(0.988);
  transition: transform 0.06s ease;
}

.command-card.is-copied {
  border-color: rgba(158, 221, 170, 0.5);
  background: rgba(158, 221, 170, 0.04);
  box-shadow:
    inset 3px 0 0 0 var(--success),
    0 0 0 1px rgba(158, 221, 170, 0.18);
}

.command-card.is-pinned {
  border-color: rgba(121, 184, 255, 0.32);
  box-shadow:
    inset 3px 0 0 0 var(--category-accent, var(--accent)),
    inset 0 0 0 1px rgba(121, 184, 255, 0.08);
}

.pin-button {
  appearance: none;
  border: none;
  background: none;
  padding: 0.28rem;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  line-height: 0;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease, background 0.14s ease;
  margin-left: auto;
  flex-shrink: 0;
}

.command-card:hover .pin-button,
.pin-button[aria-pressed="true"],
.pin-button:focus-visible {
  opacity: 1;
}

.pin-button[aria-pressed="true"] {
  color: var(--accent);
}

.pin-button:hover {
  background: rgba(121, 184, 255, 0.1);
  color: var(--accent);
}

.pin-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.pin-button svg {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  transition: fill 0.16s ease;
}

.pin-button[aria-pressed="true"] svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.command-card:hover .command-line {
  border-color: var(--category-accent-border, rgba(121, 184, 255, 0.34));
  box-shadow:
    inset 3px 0 0 0 var(--category-accent, var(--accent)),
    0 0 0 1px rgba(255, 255, 255, 0.02);
}

.card-top,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--category-accent-border, rgba(121, 184, 255, 0.18));
  background: var(--category-accent-soft, rgba(121, 184, 255, 0.06));
  color: color-mix(in srgb, var(--category-accent, var(--accent)) 68%, white);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.has-active-filter .category-badge {
  display: none;
}

.category-badge-button {
  appearance: none;
  border: 1px solid rgba(121, 184, 255, 0.18);
  font: inherit;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.12s ease;
}

.category-badge-button:hover {
  border-color: rgba(121, 184, 255, 0.42);
  background: rgba(121, 184, 255, 0.1);
  color: var(--text-primary);
  transform: translateY(-1px);
}

body.has-active-filter .category-badge-button {
  opacity: 0.5;
}

body.has-active-filter .category-badge-button:hover {
  opacity: 1;
}

.category-badge-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(121, 184, 255, 0.16);
}

.command-block {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
  opacity: 0;
  transition:
    opacity 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease;
}

.command-block:hover .copy-button,
.command-card:focus-within .copy-button,
.copy-button:focus-visible,
.copy-button.is-copied {
  opacity: 1;
}

.copy-button.is-copied {
  color: #0c1610;
  background: var(--success);
  border-color: rgba(158, 221, 170, 0.5);
}

.command-line {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: #060d14;
  border: 1px solid rgba(121, 184, 255, 0.24);
  box-shadow: inset 3px 0 0 0 var(--category-accent, var(--accent));
  color: var(--accent-strong);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.placeholder-fields,
.placeholder-fields * {
  cursor: auto;
  user-select: text;
}

.placeholder-fields {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(121, 184, 255, 0.22);
}

.placeholder-field {
  display: grid;
  gap: 0.35rem;
}

.placeholder-field span {
  color: var(--text-dim);
  line-height: 1.5;
  font-size: 0.82rem;
}

.placeholder-input {
  width: 100%;
}

mark {
  background: rgba(121, 184, 255, 0.18);
  color: var(--accent-strong);
  border-radius: 4px;
  padding: 0 0.12rem;
}

.description {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

.notes {
  margin: 0;
  padding-left: 0.75rem;
  border-left: 2px solid rgba(200, 160, 106, 0.55);
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 0.82rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.tag-btn {
  appearance: none;
  border: none;
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.tag-btn:hover {
  background: rgba(121, 184, 255, 0.14);
  color: var(--accent);
}

.tag-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

.empty-state,
.error-state {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: var(--surface);
}

.empty-state h3,
.error-state h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.empty-state h3 {
  font-size: 0.95rem;
}

.empty-state p,
.error-state p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9rem;
}

.footer {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.8rem;
}

.footer p {
  margin: 0;
  line-height: 1.5;
}

.scroll-top-btn {
  position: fixed;
  right: calc(1rem + env(safe-area-inset-right, 0px));
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 184, 255, 0.24);
  background: rgba(16, 23, 34, 0.46);
  backdrop-filter: blur(12px);
  color: var(--accent-strong);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.scroll-top-btn:hover {
  border-color: rgba(121, 184, 255, 0.42);
  background: rgba(16, 23, 34, 0.72);
  transform: translateY(-1px);
}

.scroll-top-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(121, 184, 255, 0.16),
    0 16px 36px rgba(0, 0, 0, 0.24);
}

.scroll-top-btn[hidden] {
  display: none;
}

.scroll-top-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.noscript-banner {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 320px;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(200, 160, 106, 0.12);
  border: 1px solid rgba(200, 160, 106, 0.2);
  color: #dec39f;
  font-size: 0.84rem;
}

@media (hover: none) {
  .copy-button {
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(calc(100% - 1rem), var(--content-width));
    padding-top: 0.75rem;
  }

  .hero {
    padding: 0.75rem;
  }

  .hero-grid,
  .toolbar,
  .footer,
  .section-header,
  .card-top,
  .card-footer,
  .hero-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    display: flex;
  }

  .sticky-search-bar {
    top: 0.6rem;
    width: min(calc(100% - 1rem), var(--content-width));
  }

  .sticky-search-shell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
  }

  .sticky-active-category,
  .sticky-clear-btn,
  .picker-wrap-sticky {
    width: 100%;
  }

  .secure-form {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 0.7rem;
    padding-bottom: 0.75rem;
  }

  .result-summary {
    white-space: normal;
  }

  .footer p:last-child {
    display: none;
  }

  .pagination {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pagination-actions {
    justify-content: flex-start;
  }

  .category-picker {
    right: 0;
  }
}

@media (min-width: 1500px) {
  .app-shell {
    width: min(calc(100% - 2.5rem), 1400px);
  }

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

/* ── Card entrance animation ─────────────────────────────── */
@keyframes card-in {
  from { translate: 0 8px; opacity: 0; }
  to   { translate: 0 0;   opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  .command-card {
    animation: card-in 0.18s ease both;
  }

  .command-card:nth-child(2) { animation-delay: 20ms; }
  .command-card:nth-child(3) { animation-delay: 40ms; }
  .command-card:nth-child(4) { animation-delay: 60ms; }
  .command-card:nth-child(5) { animation-delay: 80ms; }
  .command-card:nth-child(6) { animation-delay: 100ms; }
}

/* ── Filter pill sliding indicator ──────────────────────── */
.filter-bar {
  position: relative;
}

.filter-indicator {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: rgba(121, 184, 255, 0.1);
  border: 1px solid rgba(121, 184, 255, 0.38);
  pointer-events: none;
  opacity: 0;
  z-index: 0;
}

.filter-indicator.is-ready {
  transition:
    transform 0.26s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.18s ease;
}

.filter-pill {
  position: relative;
  z-index: 1;
}

/* ── View Transition ─────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) {
    animation-duration: 0.14s;
    animation-timing-function: ease;
  }

  ::view-transition-new(root) {
    animation-duration: 0.18s;
    animation-timing-function: ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-image-pair(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
