:root {
  --red: #c8102e;
  --red-d: #a50e2a;
  --red-tint: #fdf2f3;
  --charcoal: #2d2d2d;
  --body: #3a3a3a;
  --muted: #525866;
  --offwhite: #f7f7f8;
  --lightgrey: #f2f2f4;
  --silver: #ececee;
  --border: #e4e4e7;
  --white: #fff;
  --green: #15803d;
  --green-tint: #ecfdf3;
  --amber: #9a6400;
  --amber-tint: #fef3e2;
  --ok: var(--green);
  --danger: var(--red);
  --warn: var(--amber);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --text-xs: 0.6875rem;
  --text-xs-track: 0.14em;
  --text-sm: 0.8125rem;
  --text-sm-track: 0.01em;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.375rem;
  --text-3xl: 3.25rem;
  --text-display: clamp(2.4rem, 7vw, 3.75rem);
  --text-display-track: -0.038em;
  --text-h1-track: -0.03em;
  --text-h2-track: -0.02em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 2rem;
  --radius-full: 999px;
  --radius: var(--radius-md);

  --shadow-xs: 0 1px 2px rgba(28, 28, 36, 0.04);
  --shadow-sm: 0 2px 10px rgba(28, 28, 36, 0.045), 0 1px 2px rgba(28, 28, 36, 0.03);
  --shadow-md: 0 10px 28px rgba(28, 28, 36, 0.06), 0 2px 8px rgba(28, 28, 36, 0.035);
  --shadow-lg: 0 28px 56px rgba(28, 28, 36, 0.08), 0 8px 18px rgba(28, 28, 36, 0.04);
  --shadow: var(--shadow-sm);

  --bezel-pad: 6px;
  --bezel-outer-bg: rgba(24, 24, 32, 0.035);
  --bezel-outer-ring: rgba(24, 24, 32, 0.055);
  --bezel-inner-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.72);
  --bezel-radius-outer: var(--radius-xl);
  --bezel-radius-inner: calc(var(--radius-xl) - var(--bezel-pad));

  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 20;
  --z-nav: 30;
  --z-overlay: 40;
  --z-modal: 50;
  --z-toast: 60;
  --z-grain: 70;

  --ease-out-expo: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-fast: 180ms;
  --duration-med: 320ms;
  --duration-slow: 700ms;
  --duration-reveal: 840ms;

  --shell-max: 1080px;
  --shell-pad: 1.25rem;
  --topbar-offset: 5.5rem;
  --touch: 44px;

  --font-display: var(--font-geist-sans), ui-sans-serif, sans-serif;
  --font-body: var(--font-geist-sans), ui-sans-serif, sans-serif;
  --font-mono: var(--font-geist-mono), ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1200px 520px at 50% -8%, rgba(200, 16, 46, 0.05), transparent 58%),
    linear-gradient(180deg, #f4f4f6 0%, var(--offwhite) 38%, #fbfbfc 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-base);
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
label,
select,
textarea {
  font: inherit;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend.section-title {
  padding: 0;
  width: 100%;
  margin-bottom: var(--space-2);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -6rem;
  z-index: calc(var(--z-grain) + 1);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--charcoal);
  color: var(--white);
  font-weight: var(--weight-semibold);
}

.skip-link:focus,
.skip-link:focus-visible {
  top: var(--space-4);
  outline-offset: 2px;
}

.tabular {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.site-frame {
  width: 100%;
  min-height: 100%;
  padding-top: calc(var(--topbar-offset) + var(--space-5));
}

.app-shell {
  width: min(var(--shell-max), calc(100% - var(--shell-pad)));
  max-width: 100%;
  margin: 0 auto;
  padding: 0 0 var(--space-16);
}

/* Floating glass island nav */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-4) var(--shell-pad) 0;
  pointer-events: none;
  background: transparent;
  border: none;
}

.topbar-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.45rem 0.55rem 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: var(--radius-full);
  box-shadow:
    0 0 0 1px rgba(24, 24, 32, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    var(--shadow-md);
}

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  min-height: var(--touch);
  padding-right: 0.25rem;
}

.brand-logo {
  display: block;
  height: 32px;
  width: auto;
}

.brand-tag {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--text-xs-track);
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 0.65rem;
  line-height: 1.2;
}

.nav-desktop {
  display: none;
  gap: 0.1rem;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
}

.nav a,
.nav-desktop a {
  padding: 0.45rem 0.7rem;
  min-height: var(--touch);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--charcoal);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  border-radius: var(--radius-full);
  transition:
    color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo);
}

.nav a svg,
.nav-desktop a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-desktop a svg {
  display: none;
}

.nav a:hover,
.nav-desktop a:hover {
  color: var(--red);
  text-decoration: none;
  background: var(--red-tint);
}

.nav a.nav-link-active,
.nav a[aria-current="page"],
.nav-desktop a.nav-link-active,
.nav-desktop a[aria-current="page"] {
  color: var(--red);
  background: var(--red-tint);
}

.nav-user {
  font-size: var(--text-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  padding: 0 0.4rem;
}

.nav-logout {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.75rem;
  min-height: var(--touch);
  color: var(--muted);
  font: inherit;
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition:
    color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-out-expo);
}

.nav-logout:hover {
  color: var(--red);
  background: var(--red-tint);
}

.nav-logout:active {
  transform: scale(0.98);
}

.nav-toggle {
  appearance: none;
  position: relative;
  width: var(--touch);
  height: var(--touch);
  border: 0;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--charcoal);
  z-index: calc(var(--z-modal) + 1);
}

.nav-toggle-bar {
  position: absolute;
  left: 13px;
  right: 13px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--duration-med) var(--ease-out-expo);
}

.nav-toggle-bar:first-child {
  top: 19px;
}

.nav-toggle-bar:last-child {
  top: 25px;
}

.nav-toggle.is-open .nav-toggle-bar:first-child {
  top: 22px;
  transform: rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:last-child {
  top: 22px;
  transform: rotate(-45deg);
}

.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  padding: calc(var(--topbar-offset) + var(--space-6)) var(--space-6) var(--space-8);
  background: rgba(250, 250, 251, 0.86);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-drawer-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.85rem 0.4rem;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--text-h2-track);
  color: var(--charcoal);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(2.5rem);
}

.nav-drawer.is-open .nav-drawer-links a {
  animation: drawer-in var(--duration-slow) var(--ease-out-expo) forwards;
}

.nav-drawer.is-open .nav-drawer-links li:nth-child(1) a { animation-delay: 80ms; }
.nav-drawer.is-open .nav-drawer-links li:nth-child(2) a { animation-delay: 130ms; }
.nav-drawer.is-open .nav-drawer-links li:nth-child(3) a { animation-delay: 180ms; }
.nav-drawer.is-open .nav-drawer-links li:nth-child(4) a { animation-delay: 230ms; }
.nav-drawer.is-open .nav-drawer-links li:nth-child(5) a { animation-delay: 280ms; }

.nav-drawer-links a.nav-link-active,
.nav-drawer-links a[aria-current="page"] {
  color: var(--red);
}

.nav-drawer-footer .nav-user {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.nav-drawer-footer {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-6);
  opacity: 0;
  transform: translateY(1.5rem);
}

.nav-drawer.is-open .nav-drawer-footer {
  animation: drawer-in var(--duration-slow) var(--ease-out-expo) 340ms forwards;
}

@keyframes drawer-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-4);
  padding: 0.15rem 0 var(--space-6);
}

.hero-expressive {
  gap: var(--space-5);
  padding-bottom: var(--space-10);
}

.hero h1,
.page-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(2rem, 5.4vw, var(--text-2xl));
  letter-spacing: var(--text-h1-track);
  line-height: 1.08;
  color: var(--charcoal);
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero-expressive h1 {
  font-size: var(--text-display);
  letter-spacing: var(--text-display-track);
  line-height: 0.98;
}

.hero p.lede,
.login-panel .lede {
  margin: 0;
  max-width: 36rem;
  font-size: var(--text-md);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  background: var(--red-tint);
  color: var(--red);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--text-xs-track);
  text-transform: uppercase;
}

.bezel {
  padding: var(--bezel-pad);
  background: var(--bezel-outer-bg);
  border-radius: var(--bezel-radius-outer);
  box-shadow: 0 0 0 1px var(--bezel-outer-ring), var(--shadow-sm);
}

.bezel-core {
  background: var(--white);
  border-radius: var(--bezel-radius-inner);
  box-shadow: var(--bezel-inner-highlight);
}

.panel,
.list,
.upload-card,
.kpi-strip,
.tool-card {
  padding: var(--bezel-pad);
  background: var(--bezel-outer-bg);
  border-radius: var(--bezel-radius-outer);
  box-shadow: 0 0 0 1px var(--bezel-outer-ring), var(--shadow-sm);
}

.panel-inner,
.list-inner,
.upload-card-inner,
.kpi-inner,
.tool-card-core {
  background: var(--white);
  border-radius: var(--bezel-radius-inner);
  box-shadow: var(--bezel-inner-highlight);
}

.panel-inner {
  padding: var(--space-5);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-gap {
  margin-top: var(--space-8);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-grow {
  flex: 2 1 12rem;
}

.self-end {
  align-self: flex-end;
}

.field > span {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--text-sm-track);
  color: var(--muted);
}

.field input[type="text"],
.field input[type="password"],
.field input[type="search"],
.field input[type="number"],
.field input:not([type]),
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  min-height: var(--touch);
  background: var(--white);
  color: var(--charcoal);
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    box-shadow var(--duration-fast) var(--ease-out-expo);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input[type="text"]:focus-visible,
.field input[type="password"]:focus-visible,
.field input[type="search"]:focus-visible,
.field input[type="number"]:focus-visible,
.field input:not([type]):focus-visible,
.field textarea:focus-visible,
.field select:focus-visible {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.login-screen {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100dvh - var(--topbar-offset) - 5rem);
  padding: var(--space-8) 0 var(--space-12);
  overflow: clip;
}

.login-screen::before {
  content: "";
  position: absolute;
  width: min(42rem, 100%);
  height: 42rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 16, 46, 0.1), transparent 64%);
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.login-panel {
  position: relative;
  width: min(440px, 100%);
}

.login-panel .panel-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-8) var(--space-6);
}

.login-panel h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 6vw, 2.8rem);
  letter-spacing: var(--text-display-track);
  color: var(--charcoal);
  line-height: 1.02;
  text-wrap: balance;
}

.error-text {
  margin: 0;
  color: var(--danger);
  font-size: var(--text-sm);
}

.slug-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.slug-row input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.slug-suffix {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  white-space: nowrap;
  padding-left: 0.15rem;
}

.field-hint {
  font-size: var(--text-sm) !important;
  font-weight: var(--weight-regular) !important;
  color: var(--muted);
}

.field-hint code,
.handover-item code,
.handover-item a,
.id-chip {
  font-family: var(--font-mono);
}

.field-hint code {
  font-size: 0.78rem;
}

.naming-preview {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--lightgrey);
}

.naming-preview code {
  display: block;
  margin-top: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  word-break: break-all;
  color: var(--charcoal);
}

.file-input {
  display: block;
  width: 100%;
  min-height: var(--touch);
  padding: 0.9rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--lightgrey);
  color: var(--charcoal);
}

.file-input:hover,
.file-input:focus-visible {
  border-color: var(--red);
  background: var(--red-tint);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 7.5rem;
  padding: var(--space-5);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--lightgrey);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-out-expo);
}

.dropzone svg {
  width: 28px;
  height: 28px;
  color: var(--red);
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.is-over {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red-d);
}

.dropzone.is-selected {
  border-style: solid;
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--charcoal);
}

.dropzone-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--charcoal);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-full);
  padding: 12px 22px;
  min-height: var(--touch);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  line-height: 1;
  transition:
    background var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo),
    opacity var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-out-expo);
  text-decoration: none;
}

.btn-sm {
  min-height: var(--touch);
  padding: 0.55rem 1rem;
  font-size: var(--text-sm);
}

.btn-lg {
  min-height: 52px;
  padding: 0.95rem 1.6rem;
  font-size: var(--text-md);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-cta {
  padding-right: 0.45rem;
  justify-content: space-between;
}

.stack > .btn {
  align-self: flex-start;
}

.login-panel .btn-cta,
.login-panel .stack > .btn-cta {
  align-self: stretch;
  width: 100%;
}

.btn-icon-trail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.16);
  transition: transform var(--duration-med) var(--ease-out-expo);
}

.btn-cta:hover:not(:disabled) .btn-icon-trail {
  transform: translate(2px, -1px) scale(1.05);
}

.btn-magnetic {
  transform: translate(var(--mx, 0px), var(--my, 0px));
}

.btn-magnetic:active:not(:disabled) {
  transform: translate(var(--mx, 0px), var(--my, 0px)) scale(0.98);
}

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch);
  height: var(--touch);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo),
    border-color var(--duration-fast) var(--ease-out-expo),
    transform var(--duration-fast) var(--ease-out-expo);
}

.icon-btn:hover {
  color: var(--red);
  background: var(--red-tint);
  border-color: #f3d3d8;
}

.icon-btn:active {
  transform: scale(0.98);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:not(:disabled):hover {
  background: var(--red-d);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  border: 1.5px solid var(--red);
  color: var(--red);
}

.btn-secondary:not(:disabled):hover {
  background: var(--red-tint);
  color: var(--red-d);
  border-color: var(--red-d);
}

.btn-danger {
  background: var(--red-tint);
  color: var(--red-d);
  border: 1px solid #f3d3d8;
}

.btn-danger:not(:disabled):hover {
  background: #f8e4e7;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  padding-inline: 0.75rem;
  min-height: var(--touch);
}

.btn-ghost:not(:disabled):hover {
  color: var(--red);
}

.confirm-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--red-tint);
}

.confirm-inline p {
  margin: 0;
  flex: 1 1 12rem;
  color: var(--red-d);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.status-line {
  min-height: 1.4rem;
  font-size: 0.95rem;
}

.status-line.error {
  color: var(--red);
}

.status-line.progress {
  color: var(--charcoal);
}

.handover {
  display: grid;
  gap: 0.75rem;
  margin: 0.25rem 0 0;
}

.handover-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--lightgrey);
}

.handover-item dt {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--text-xs-track);
  text-transform: uppercase;
  color: var(--muted);
}

.handover-item dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.handover-item dd > span {
  min-width: 0;
  overflow-wrap: break-word;
}

.handover-item code,
.handover-item a {
  font-size: 0.95rem;
  word-break: break-all;
  color: var(--charcoal);
}

.handover-item a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-end;
  margin-bottom: var(--space-5);
}

.page-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.page-header-flush {
  margin-bottom: 0;
}

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

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--text-h2-track);
  color: var(--charcoal);
}

.list-inner {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "main badge"
    "meta meta";
  gap: 0.45rem 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background var(--duration-fast) var(--ease-out-expo);
}

button.list-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  font: inherit;
  color: inherit;
  appearance: none;
}

button.list-row:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  z-index: 1;
}

.list-row .list-main {
  grid-area: main;
}

.list-row .meta {
  grid-area: meta;
}

.list-row .badge,
.list-row > .icon-btn {
  grid-area: badge;
  justify-self: end;
}

.list-row:last-child,
button.list-row:last-child {
  border-bottom: none;
}

.list-row:hover {
  background: var(--lightgrey);
}

.list-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.list-main strong {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--charcoal);
  overflow-wrap: break-word;
}

.list-main span,
.meta {
  font-size: var(--text-sm);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.badge-spin svg,
.spin {
  animation: badge-spin 1s var(--ease-out-expo) infinite;
}

@keyframes badge-spin {
  to {
    transform: rotate(360deg);
  }
}

.badge-active {
  background: var(--green-tint);
  color: var(--green);
}

.badge-disabled,
.badge-expired {
  background: var(--amber-tint);
  color: var(--amber);
}

.badge-error {
  background: var(--red-tint);
  color: var(--red-d);
}

.label-soon {
  display: inline-block;
  width: fit-content;
  margin-top: auto;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-xs);
  background: var(--lightgrey);
  color: var(--charcoal);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
}

.empty {
  padding: var(--space-10) var(--space-5);
  text-align: center;
  color: var(--muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--red-tint);
  color: var(--red);
}

.empty-state-icon svg {
  width: 26px;
  height: 26px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
  width: 100%;
  max-width: 28rem;
  min-width: 0;
  overflow-wrap: break-word;
  white-space: normal;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: var(--text-h2-track);
  color: var(--charcoal);
}

.detail-grid {
  display: grid;
  gap: var(--space-4);
}

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

.action-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.action-group-danger {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.tool-bento {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.tool-bento > .reveal {
  display: flex;
  min-width: 0;
  height: 100%;
}

.tool-card {
  display: block;
  width: 100%;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  transition: transform var(--duration-med) var(--ease-out-expo);
}

.tool-card-core {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-6);
  transition: background var(--duration-fast) var(--ease-out-expo);
}

.tool-card:hover {
  transform: translateY(-3px);
}

.tool-card:active {
  transform: scale(0.98);
}

.tool-card.is-soon {
  cursor: default;
}

.tool-card.is-soon:hover,
.tool-card.is-soon:active {
  transform: none;
}

.tool-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--red-tint);
  color: var(--red);
  margin-bottom: var(--space-4);
}

.tool-card-icon svg {
  width: 22px;
  height: 22px;
}

.tool-card.is-external .tool-card-icon {
  background: var(--lightgrey);
  color: var(--muted);
}

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

.tool-card-external {
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.tool-card-external svg {
  width: 16px;
  height: 16px;
}

.tool-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--text-h2-track);
  color: var(--charcoal);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.tool-card p {
  margin: 0;
  flex: 1 1 auto;
  font-size: var(--text-sm);
  color: var(--muted);
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.tool-card-cta {
  margin-top: auto;
  padding-top: var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--red);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.field-row .field {
  flex: 1;
  min-width: 8.5rem;
}

.site-kind-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.site-kind-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: var(--weight-regular);
  color: var(--charcoal);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--charcoal);
}

details.field summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  min-height: var(--touch);
  display: flex;
  align-items: center;
}

.details-body {
  margin-top: var(--space-2);
}

.toggle-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.toggle-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  min-height: var(--touch);
  padding: 0.55rem 1.05rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--charcoal);
  font-size: 0.9rem;
  font-weight: var(--weight-medium);
  cursor: pointer;
  user-select: none;
  white-space: normal;
  text-wrap: pretty;
  transition:
    border-color var(--duration-fast) var(--ease-out-expo),
    background var(--duration-fast) var(--ease-out-expo),
    color var(--duration-fast) var(--ease-out-expo);
}

.toggle-chip:hover {
  border-color: var(--red);
}

.toggle-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-chip svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--muted);
}

.toggle-chip-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  color: transparent;
}

.toggle-chip-check svg {
  width: 11px;
  height: 11px;
  color: inherit;
}

.toggle-chip.is-active {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red-d);
}

.toggle-chip.is-active svg {
  color: var(--red);
}

.toggle-chip.is-active .toggle-chip-check {
  border-color: var(--red);
  background: var(--red);
  color: var(--white);
}

.upload-card-inner {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.upload-card-header .field {
  flex: 1;
  min-width: 0;
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-xs);
  background: var(--lightgrey);
  color: var(--charcoal);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.summary-chip svg {
  width: 14px;
  height: 14px;
}

.summary-chip.is-warn {
  background: var(--amber-tint);
  color: var(--amber);
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-sm);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat-pill svg {
  width: 14px;
  height: 14px;
}

.id-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.shortlink-row {
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "meta"
    "actions";
}

.shortlink-row .actions {
  grid-area: actions;
}

.bulk-item-row {
  grid-template-columns: 1fr;
  grid-template-areas:
    "main"
    "results";
  align-items: flex-start;
}

.bulk-item-row .bulk-item-results {
  grid-area: results;
}

.bulk-item-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.bulk-results-table {
  width: 100%;
  border-collapse: collapse;
}

.bulk-results-table th,
.bulk-results-table td {
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.bulk-results-table th {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--text-xs-track);
  text-transform: uppercase;
  color: var(--muted);
}

.bulk-item-target {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bulk-item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.bulk-item-links a {
  color: var(--red);
  text-decoration: underline;
  font-size: var(--text-sm);
}

.bulk-item-dm {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-basis: 100%;
  max-width: 100%;
}

.bulk-item-dm textarea {
  resize: vertical;
  font-size: var(--text-sm);
  font-family: inherit;
  width: 100%;
}

.note {
  font-size: var(--text-sm);
  color: var(--muted);
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: var(--space-5);
}

.pipeline-step {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.pipeline-step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  color: var(--muted);
  margin-top: 0.1rem;
}

.pipeline-step-icon svg {
  width: 14px;
  height: 14px;
}

.pipeline-step.is-done .pipeline-step-icon {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-tint);
}

.pipeline-step.is-active .pipeline-step-icon {
  border-color: var(--red);
  color: var(--red);
  animation: pipeline-pulse 1.4s var(--ease-out-expo) infinite;
}

.pipeline-step.is-failed .pipeline-step-icon {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--red-tint);
}

@keyframes pipeline-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.72;
  }
}

.pipeline-step-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pipeline-step-label {
  font-weight: var(--weight-medium);
  color: var(--charcoal);
}

.pipeline-step.is-todo .pipeline-step-label {
  color: var(--muted);
}

.pipeline-step-detail {
  font-size: var(--text-sm);
  color: var(--muted);
}

.kpi-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem;
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--text-xs-track);
}

.kpi-value {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--charcoal);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.kpi-value.is-plain {
  font-family: var(--font-body);
  font-size: var(--text-base);
}

.summary-model-note {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--text-xs-track);
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.summary-body {
  margin: 0;
}

.keyword-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.keyword-filters .toggle-chip-group {
  flex: 1 1 100%;
}

.keyword-filters input[type="search"],
.keyword-filters input[type="number"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  min-height: var(--touch);
  background: var(--white);
  flex: 1 1 8.5rem;
  min-width: 0;
}

.keyword-filters input[type="number"] {
  flex: 0 1 7.5rem;
}

.keyword-table-wrap {
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--white) 30%, transparent) 0 0 / 28px 100% local no-repeat,
    linear-gradient(to left, var(--white) 30%, transparent) 100% 0 / 28px 100% local no-repeat,
    linear-gradient(to right, rgba(28, 28, 36, 0.1), transparent) 0 0 / 14px 100% scroll no-repeat,
    linear-gradient(to left, rgba(28, 28, 36, 0.1), transparent) 100% 0 / 14px 100% scroll no-repeat;
}

.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.keyword-table th,
.keyword-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.keyword-table th {
  color: var(--muted);
  font-weight: var(--weight-medium);
  user-select: none;
}

.keyword-table th button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--touch);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.keyword-table th button:hover {
  color: var(--charcoal);
}

.keyword-table th[aria-sort="ascending"] button,
.keyword-table th[aria-sort="descending"] button {
  color: var(--charcoal);
  font-weight: var(--weight-semibold);
}

.keyword-table th[aria-sort="ascending"] button::after {
  content: " ↑";
  font-family: var(--font-mono);
  color: var(--red);
}

.keyword-table th[aria-sort="descending"] button::after {
  content: " ↓";
  font-family: var(--font-mono);
  color: var(--red);
}

.keyword-table td.num,
.keyword-table th.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.keyword-table tbody tr:hover {
  background: var(--lightgrey);
}

.kw-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: normal;
}

.seed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-xs);
  background: var(--red-tint);
  color: var(--red);
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
}

.kd-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  background: var(--lightgrey);
}

.kd-band-low {
  background: var(--green-tint);
  color: var(--green);
}

.kd-band-mid {
  background: var(--amber-tint);
  color: var(--amber);
}

.kd-band-high {
  background: var(--red-tint);
  color: var(--red);
}

.heat-badge,
.intent-badge,
.conf-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--lightgrey);
  color: var(--muted);
}

.conf-badge.conf-high {
  background: var(--green-tint);
  color: var(--green);
}

.conf-badge.conf-medium {
  background: var(--amber-tint);
  color: var(--amber);
}

.conf-badge.conf-low {
  background: var(--lightgrey);
  color: var(--muted);
}

.table-note {
  font-size: var(--text-sm) !important;
}

.filter-empty {
  padding: var(--space-4);
}

.copy-fail {
  color: var(--amber);
  font-size: var(--text-sm);
}

.skeleton {
  display: block;
  background: linear-gradient(90deg, var(--lightgrey), var(--silver), var(--lightgrey));
  background-size: 200% 100%;
  animation: shimmer 1.4s var(--ease-out-expo) infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 0.85rem;
  margin-bottom: var(--space-3);
}

.skeleton-title {
  height: 2rem;
  width: min(16rem, 70%);
  margin-bottom: var(--space-4);
}

.skeleton-card {
  height: 8.5rem;
}

.skeleton-row {
  height: 4.2rem;
  margin-bottom: var(--space-2);
}

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

.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  filter: blur(8px);
  transition:
    opacity var(--duration-reveal) var(--ease-out-expo),
    transform var(--duration-reveal) var(--ease-out-expo),
    filter var(--duration-reveal) var(--ease-out-expo);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-d1 { transition-delay: 70ms; }
.reveal-d2 { transition-delay: 140ms; }
.reveal-d3 { transition-delay: 210ms; }
.reveal-d4 { transition-delay: 280ms; }
.reveal-d5 { transition-delay: 350ms; }

.meta-icon {
  display: inline-flex;
  vertical-align: -2px;
  margin-right: 0.25rem;
}

@media (max-width: 479px) {
  .brand-tag {
    display: none;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn,
  .actions .btn-cta {
    width: 100%;
    justify-content: space-between;
  }

  .actions .btn-ghost,
  .actions .btn-secondary,
  .actions .btn-danger {
    justify-content: center;
  }

  .field-row {
    flex-direction: column;
  }

  .self-end {
    align-self: stretch;
  }
}

@media (min-width: 480px) {
  .slug-row {
    flex-direction: row;
    align-items: center;
  }

  .slug-suffix {
    padding-left: 0;
  }

  .bulk-item-dm {
    max-width: 420px;
  }
}

@media (min-width: 768px) {
  :root {
    --shell-pad: 2rem;
  }

  .app-shell {
    padding-bottom: var(--space-20);
  }

  .hero-home {
    min-height: auto;
    padding-bottom: var(--space-8);
  }

  .detail-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .list-row {
    grid-template-columns: 1.4fr 1fr auto;
    grid-template-areas: "main meta badge";
    gap: 0.75rem 1rem;
    padding: 1rem 1.1rem;
  }

  .shortlink-row {
    grid-template-columns: 1.4fr 1fr auto;
    grid-template-areas: "main meta actions";
  }

  .bulk-item-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "results";
  }

  .tool-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }

  .span-7,
  .span-5,
  .tool-bento > .reveal:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .page-header-actions .btn-primary,
  .actions .btn-primary {
    flex: 0 0 auto;
  }
}

@media (max-width: 767px) {
  .list-main span,
  .meta {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .page-header {
    align-items: stretch;
  }

  .page-header-actions {
    width: 100%;
  }

  .page-header-actions .btn-primary {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  .actions {
    align-items: stretch;
  }

  .actions .btn-primary,
  .actions .btn-cta {
    flex: 0 1 auto;
  }

  .list-main strong {
    white-space: normal;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
  }

  .field-hint code {
    word-break: break-all;
    white-space: normal;
  }

  .keyword-table th:first-child,
  .keyword-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--white);
    box-shadow: 4px 0 8px rgba(28, 28, 36, 0.04);
  }

  .keyword-table td:first-child {
    white-space: normal;
    min-width: 10rem;
    max-width: 14rem;
  }

  .keyword-table td:not(:first-child) {
    white-space: nowrap;
  }
}

@media (min-width: 1024px) {
  .nav-toggle {
    display: none;
  }

  .nav-desktop {
    display: flex;
  }

  .nav-desktop .nav-user {
    display: none;
  }

  .topbar-inner {
    width: max-content;
    max-width: 100%;
  }

  .hero-home {
    min-height: auto;
  }

  .tool-bento {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .span-7 { grid-column: span 7; }
  .span-6 { grid-column: span 6; }
  .span-5 { grid-column: span 5; }
  .span-4 { grid-column: span 4; }
  .span-3 { grid-column: span 3; }

  .tool-bento > .reveal:last-child:nth-child(odd) {
    grid-column: span 4;
  }

  .span-7 .tool-card-core {
    min-height: 14rem;
  }

  .kpi-inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bulk-item-row {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 1.4fr);
    grid-template-areas: "main results";
  }
}

@media (min-width: 1280px) {
  :root {
    --shell-pad: 2.5rem;
  }

  .nav-desktop .nav-user {
    display: inline;
  }
}

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

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

  .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .nav-drawer-links a,
  .nav-drawer-footer {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
