:root {
  color-scheme: dark;
  --bg: #0a0c0f;
  --bg-elevated: #10141a;
  --panel: #151a21;
  --panel-2: #1a2129;
  --text: #eef2f6;
  --muted: #8b98a8;
  --line: #252e38;
  --line-strong: #33404d;
  --accent: #ff5a6a;
  --accent-dark: #ff8a96;
  --teal: #3dd9c3;
  --warn: #f5b84a;
  --ok: #5ee08f;
  --danger: #f25555;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.18);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --header-height: 72px;
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.01em;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 90, 106, 0.12), transparent 60%),
    linear-gradient(180deg, #0d1014 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 75%);
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-6);
}

.page-content > .panel,
.page-content > section.panel,
.admin-main > .panel,
.admin-main > section.panel {
  margin-bottom: var(--space-4);
}

.page-content > .panel:last-child,
.admin-main > .panel:last-child {
  margin-bottom: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: var(--space-4);
  padding: var(--space-2) 0;
  background: rgba(10, 12, 15, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header-inner {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}

.site-header .topbar,
.site-header .public-header,
.site-header-inner .public-header {
  margin-bottom: 0;
}

.topbar,
.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.public-header {
  min-height: 56px;
}

.page-intro {
  margin-bottom: var(--space-4);
}

.page-intro h1 {
  margin-bottom: var(--space-1);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.05rem;
  margin-bottom: var(--space-2);
  color: #ffffff;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.topbar p,
.muted {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.6;
  font-weight: 400;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: clamp(18px, 3vw, 26px);
  margin-bottom: var(--space-4);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

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

.setup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setup-card .button {
  margin-top: 10px;
  align-self: flex-start;
}

.setup-card .status-pill.inline {
  margin-bottom: 2px;
}

.setup-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.setup-notice {
  grid-column: 1 / -1;
}

.setup-notice-full {
  margin-bottom: 12px;
}

.flash-notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  line-height: 1.5;
  font-size: 0.9375rem;
  font-weight: 500;
}

.flash-notice.flash-success {
  background: rgba(94, 224, 143, 0.1);
  border-color: rgba(94, 224, 143, 0.28);
  color: #8ef0b0;
}

.flash-notice.flash-info {
  background: rgba(61, 217, 195, 0.08);
  border-color: rgba(61, 217, 195, 0.22);
  color: #7de8d8;
}

.flash-notice.flash-error {
  background: rgba(242, 85, 85, 0.1);
  border-color: rgba(242, 85, 85, 0.28);
  color: #ff9a9a;
}

.flash-notice.flash-warning {
  background: rgba(255, 193, 94, 0.1);
  border-color: rgba(255, 193, 94, 0.28);
  color: #ffd27a;
}

.grid > div,
.topbar > div,
.job-main {
  min-width: 0;
}

.job-header-main {
  flex: 1 1 320px;
  min-width: 0;
}

.job-header-main h1,
.job-header-main p {
  overflow-wrap: anywhere;
}

.job-header-main p {
  max-width: 78ch;
}

#jobStatus {
  overflow-wrap: anywhere;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: white;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 8px 20px rgba(255, 90, 106, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 90, 106, 0.28);
}

.button.secondary,
button.secondary {
  background: var(--panel-2);
  color: #e2e8f0;
  border-color: var(--line);
  box-shadow: none;
}

.button.secondary:hover,
button.secondary:hover {
  background: #222a33;
  border-color: var(--line-strong);
  box-shadow: none;
}

button.danger {
  background: var(--danger);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.18);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.actions,
.top-actions,
.public-nav,
.public-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.top-actions form {
  margin: 0;
}

.actions button,
.actions .button {
  margin-top: 0;
}

.status-pill {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(246, 184, 74, 0.1);
  border: 1px solid rgba(246, 184, 74, 0.2);
  color: var(--warn);
}

.status-pill.ok {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.24);
  color: var(--ok);
}

.status-pill.inline {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
}

.notice {
  margin-top: 12px;
  color: var(--warn);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.tiny {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

code {
  background: #0e1318;
  border: 1px solid #26313b;
  color: #c7d2dc;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

a {
  color: var(--teal);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  border-color: rgba(61, 217, 195, 0.6);
  box-shadow: 0 0 0 3px rgba(61, 217, 195, 0.1);
}

input::placeholder {
  color: #65727e;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 42px 0 14px;
  font: inherit;
  background-color: var(--bg-elevated);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8b95a8 50%), linear-gradient(135deg, #8b95a8 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus {
  border-color: rgba(61, 217, 195, 0.6);
  box-shadow: 0 0 0 3px rgba(61, 217, 195, 0.1);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.start-profile-form {
  grid-template-columns: minmax(190px, 240px) minmax(320px, 1fr) minmax(210px, 240px);
  grid-template-areas:
    "source target action"
    ". help help";
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
}

.start-job-panel {
  position: relative;
  overflow: hidden;
}

.start-job-panel::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -150px;
  top: -170px;
  border-radius: 50%;
  background: rgba(255, 90, 106, 0.08);
  filter: blur(8px);
  pointer-events: none;
}

.start-job-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.start-job-heading h2 {
  margin-bottom: 4px;
}

.start-job-heading p {
  max-width: 680px;
  font-size: 0.9rem;
}

.start-job-badge {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid rgba(61, 217, 195, 0.26);
  border-radius: 999px;
  background: rgba(61, 217, 195, 0.08);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.start-profile-mode {
  grid-area: source;
}

.start-profile-url {
  grid-area: target;
}

.start-job-help {
  grid-area: help;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.start-profile-form label {
  min-width: 0;
}

.start-profile-form label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.start-profile-url input,
.start-profile-mode select {
  min-height: 54px;
  border-radius: 10px;
  font-size: 0.98rem;
}

.start-profile-submit {
  grid-area: action;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding-inline: 22px;
  white-space: nowrap;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-shell {
  width: min(430px, calc(100% - 32px));
}

.auth-panel {
  margin-bottom: 0;
  padding: clamp(24px, 4vw, 32px);
  box-shadow: var(--shadow);
  border-radius: var(--radius-md);
}

.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  margin-bottom: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.auth-panel h1 {
  margin-bottom: 8px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form button {
  width: 100%;
}

.public-shell {
  width: min(1080px, calc(100% - 40px));
}

.brand-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-line img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.public-nav a:not(.button) {
  color: #c8d4df;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  padding: 8px 4px;
  transition: color 0.15s ease;
}

.public-nav a:not(.button):hover {
  color: #ffffff;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-5) 0 var(--space-4);
}

.public-hero h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.public-hero p {
  max-width: 640px;
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.public-logo {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.public-info {
  margin-bottom: var(--space-4);
}

.public-info h2 {
  margin-bottom: var(--space-2);
}

.public-info p,
.legal p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 1rem;
}

.legal-shell {
  width: min(920px, calc(100% - 40px));
}

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

.legal h2 {
  margin-bottom: -4px;
  margin-top: var(--space-2);
}

.legal h2:first-child {
  margin-top: 0;
}

.guide-shell {
  width: min(980px, calc(100% - 40px));
}

.guide-hero {
  padding: var(--space-5) 0 var(--space-4);
}

.guide-kicker {
  margin: 0 0 var(--space-1);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.guide-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.guide-hero > p:not(.guide-kicker) {
  max-width: 760px;
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.guide-card {
  display: grid;
  gap: var(--space-3);
}

.guide-card h2,
.guide-step h2 {
  margin: 0;
}

.guide-card p,
.guide-step p {
  margin: 0;
}

.guide-checklist,
.guide-message ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.guide-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px var(--space-4);
}

.guide-checklist li,
.guide-message li {
  padding-left: 4px;
}

.guide-note,
.guide-success {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1.55;
}

.guide-note {
  color: var(--warn);
  background: rgba(245, 184, 74, 0.08);
  border: 1px solid rgba(245, 184, 74, 0.18);
}

.guide-success {
  color: var(--ok);
  background: rgba(94, 224, 143, 0.08);
  border: 1px solid rgba(94, 224, 143, 0.18);
}

.guide-steps {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.guide-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.guide-step > div {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.guide-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(61, 217, 195, 0.12);
  border: 1px solid rgba(61, 217, 195, 0.28);
  color: var(--teal);
  font-weight: 800;
}

.guide-step a {
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.guide-step a:hover {
  text-decoration: underline;
}

.guide-message {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
}

.guide-problems {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.guide-problems div {
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.guide-problems strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.guide-problems p {
  color: var(--muted);
}

.jobs {
  display: grid;
  gap: var(--space-2);
}

.publishing-dash-group {
  margin: 0;
}

.publishing-dash-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  list-style: none;
}

.publishing-dash-summary::-webkit-details-marker {
  display: none;
}

.publishing-dash-summary h2 {
  margin: 0;
}

.publishing-dash-summary .muted {
  margin: .35rem 0 0;
}

.publishing-dash-list {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.publishing-dash-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.publishing-dash-main {
  min-width: 0;
  display: grid;
  gap: .3rem;
}

.publishing-dash-main strong {
  color: var(--text);
}

.publishing-dash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.publishing-dash-empty {
  margin: var(--space-3) 0 0;
}

.publishing-user-page .publishing-editor {
  margin-top: .5rem;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.job-main {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) max-content minmax(220px, 1.2fr) minmax(120px, 220px);
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.job-title,
.job-stage,
.job-meta {
  min-width: 0;
}

.job-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-main strong {
  color: var(--teal);
}

.job-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.job-progress {
  min-width: 120px;
}

.job-row-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: flex-end;
}

.job-row form,
.job-row-actions form {
  margin: 0;
}

button.small {
  min-height: 34px;
  padding: 0 12px;
  margin-top: 0;
}

.meter,
.small-meter {
  background: #0e1318;
  border: 1px solid #202a33;
  border-radius: 999px;
  overflow: hidden;
}

.meter {
  height: 15px;
  margin-bottom: 18px;
}

.small-meter {
  height: 11px;
  margin: 14px 0;
}

#bar,
#currentBar {
  width: 0;
  height: 100%;
  transition: width 0.25s ease;
}

#bar {
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

#currentBar {
  background: var(--teal);
}

.stats,
.details {
  display: grid;
  gap: 12px;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

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

.stats div,
.details div {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: #11171d;
}

.stats span,
.details span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats strong,
.details strong {
  color: #f8fbfd;
}

.code-line {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.logs {
  margin: 0;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #090c10;
  color: #d6e1ea;
  border: 1px solid #222b34;
  border-radius: 7px;
  padding: 15px;
  font-size: 13px;
  line-height: 1.5;
}

.current {
  font-size: 18px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.links {
  display: grid;
  gap: 10px;
}

.links a {
  color: var(--teal);
  font-weight: 800;
}

.n8n-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.n8n-export button,
.n8n-export .button {
  width: fit-content;
  margin-top: 0;
}

.n8n-export p {
  flex-basis: 100%;
  margin: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-summary div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-summary strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
}

.admin-account {
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.admin-account-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.admin-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.admin-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.26);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: #dffefa;
  font-size: 18px;
  font-weight: 900;
}

.admin-identity h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.admin-identity p {
  color: var(--muted);
  font-size: 13px;
}

.admin-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  margin: 0;
  background: var(--line);
}

.admin-stats div {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 13px;
  background: #11171d;
}

.admin-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-stats strong {
  display: block;
  color: #f8fbfd;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-jobs {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.admin-job {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "main side"
    "actions actions";
  gap: 12px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1419;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.admin-job:hover {
  border-color: var(--line-strong);
  background: #111820;
}

.admin-job-main {
  grid-area: main;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.admin-job-main strong,
.admin-job-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-job-main small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.admin-progress {
  display: block;
  height: 7px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #070a0d;
}

.admin-progress i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--teal));
}

.admin-job-side {
  grid-area: side;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 5px;
  text-align: right;
}

.admin-job-side em {
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
}

.admin-job-side small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-job-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.admin-job-actions a {
  min-height: 30px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151d24;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.admin-job-actions a:hover {
  border-color: rgba(45, 212, 191, 0.36);
  background: rgba(45, 212, 191, 0.1);
}

.admin-shell {
  width: min(1380px, calc(100% - 32px));
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: start;
}

.admin-main {
  min-width: 0;
}

.admin-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 12px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, #ffffff 12%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.admin-nav-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.admin-nav-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: center;
  padding: 12px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.admin-nav-link span {
  font-size: 14px;
  font-weight: 700;
}

.admin-nav-link small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
}

.admin-nav-link:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.admin-nav-link.active {
  border-color: rgba(255, 77, 94, 0.45);
  background: rgba(255, 77, 94, 0.1);
}

.admin-nav-badge {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  place-items: center;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
  color: #dffefa;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.admin-nav-badge.warn {
  background: rgba(246, 180, 75, 0.18);
  color: #ffe8b5;
}

.admin-nav-badge.hidden {
  display: none;
}

.admin-nav-meta {
  margin-bottom: 0;
  padding: 16px;
}

.admin-nav-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.admin-nav-stat:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.admin-nav-stat span {
  color: var(--muted);
  font-size: 12px;
}

.admin-nav-stat strong {
  font-size: 14px;
}

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.admin-toolbar-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.admin-toolbar-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-toolbar-filters select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
}

.admin-table-wrap {
  overflow-x: auto;
  padding: 0;
}

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

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table .block {
  display: block;
  margin-top: 4px;
}

.stage-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
}

.stage-pill.stage-complete {
  background: rgba(74, 222, 128, 0.16);
  color: #bbf7d0;
}

.stage-pill.stage-failed,
.stage-pill.stage-stopped {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.stage-pill.stage-downloading,
.stage-pill.stage-uploading,
.stage-pill.stage-collecting {
  background: rgba(45, 212, 191, 0.14);
  color: #ccfbf1;
}

.stage-pill.stage-paused,
.stage-pill.stage-queued {
  background: rgba(246, 180, 75, 0.16);
  color: #fde68a;
}

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

.admin-section-head {
  margin-bottom: 14px;
}

.admin-section-head h2 {
  margin-bottom: 4px;
}

.admin-queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-queue-item strong {
  display: block;
  margin-bottom: 4px;
}

.admin-queue-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.status-pill.small {
  padding: 4px 8px;
  font-size: 11px;
}

.n8n-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.n8n-health-grid span.muted {
  display: block;
  margin-top: 0;
  font-size: 12px;
  margin-bottom: 6px;
}

.n8n-health-grid strong,
.n8n-health-grid a {
  font-size: 14px;
}

.n8n-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.n8n-toolbar .button {
  margin-top: 0;
}

.n8n-error-text {
  margin-top: 8px;
  color: #fecaca;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.n8n-fail-item {
  align-items: flex-start;
}

.text-ok {
  color: var(--ok);
}

.text-danger {
  color: var(--danger);
}

.stage-pill.stage-error,
.stage-pill.stage-failed,
.stage-pill.stage-crashed {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.stage-pill.stage-success {
  background: rgba(74, 222, 128, 0.16);
  color: #bbf7d0;
}

.stage-pill.stage-running,
.stage-pill.stage-waiting {
  background: rgba(246, 180, 75, 0.16);
  color: #fde68a;
}

.connections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.connection-group-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.connection-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: var(--space-2);
}

@media (max-width: 760px) {
  .shell,
  .public-shell,
  .legal-shell,
  .admin-shell {
    width: min(100%, calc(100% - 24px));
    padding: var(--space-3) 0 var(--space-5);
  }

  .site-header-inner {
    width: min(100%, calc(100% - 24px));
  }

  .site-header {
    margin-bottom: var(--space-3);
    padding: var(--space-2) 0;
  }

  .page-content > .panel,
  .page-content > section.panel,
  .admin-main > .panel {
    margin-bottom: var(--space-3);
  }

  .panel {
    padding: var(--space-3);
    border-radius: var(--radius-sm);
  }

  .topbar,
  .form {
    grid-template-columns: 1fr;
    display: grid;
    gap: var(--space-3);
  }

  .start-profile-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "source"
      "target"
      "help"
      "action";
  }

  .start-job-heading {
    align-items: center;
  }

  .start-job-badge {
    display: none;
  }

  .topbar {
    align-items: flex-start;
  }

  .grid,
  .admin-grid,
  .stats,
  .details,
  .public-hero {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

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

  .admin-summary div {
    padding: var(--space-3);
  }

  .admin-layout {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .admin-sidebar {
    position: static;
    order: -1;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
    padding: var(--space-2);
  }

  .n8n-health-grid {
    grid-template-columns: 1fr;
  }

  .admin-nav-link {
    padding: var(--space-2);
  }

  .admin-nav-link small {
    display: none;
  }

  .admin-nav-meta {
    display: none;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .admin-queue-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .status-pill {
    width: fit-content;
  }

  .actions,
  .top-actions,
  .public-nav,
  .public-actions {
    justify-content: flex-start;
    gap: var(--space-2);
    width: 100%;
  }

  .public-header {
    display: grid;
    gap: var(--space-3);
    min-height: auto;
    align-items: flex-start;
  }

  .public-nav {
    flex-wrap: wrap;
  }

  .public-hero {
    padding: var(--space-4) 0 var(--space-3);
    gap: var(--space-4);
  }

  .public-logo {
    width: 120px;
    height: 120px;
    justify-self: start;
  }

  .public-hero h1 {
    font-size: 2rem;
  }

  .public-hero p {
    font-size: 1rem;
    margin-top: var(--space-2);
  }

  .public-actions {
    margin-top: var(--space-2);
  }

  .guide-hero {
    padding-top: var(--space-4);
  }

  .guide-checklist,
  .guide-problems {
    grid-template-columns: 1fr;
  }

  .guide-step {
    grid-template-columns: 1fr;
    padding: var(--space-3);
  }

  .guide-step-number {
    width: 38px;
    height: 38px;
  }

  .public-actions .button,
  .public-actions button {
    width: 100%;
    margin-top: 0;
  }

  .form button {
    width: 100%;
    margin-top: 0;
  }

  .job-row {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: var(--space-3);
  }

  .job-main {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .job-title,
  .job-meta {
    white-space: normal;
  }

  .job-progress {
    width: 100%;
  }

  .job-row-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .job-row form {
    width: 100%;
  }

  .job-row form button {
    width: 100%;
  }

  .admin-job {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "side"
      "actions";
    padding: var(--space-3);
  }

  .admin-job-side {
    justify-items: start;
    text-align: left;
  }

  .admin-account-head {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .admin-pills {
    justify-content: flex-start;
  }

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

  .admin-jobs {
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .setup-card .button {
    width: 100%;
  }

  .stats {
    gap: var(--space-2);
  }

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

  h1 {
    font-size: 1.5rem;
  }
}
