:root {
  color-scheme: light;
  --bg: #eef6ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(248, 251, 255, 0.72);
  --text: #122033;
  --muted: #64748b;
  --line: rgba(154, 181, 216, 0.46);
  --primary: #1871ff;
  --primary-strong: #0d5fdc;
  --primary-soft: #e9f2ff;
  --teal: #0f9f95;
  --warning: #b7791f;
  --danger: #d64242;
  --glass-line: rgba(255, 255, 255, 0.66);
  --shadow: 0 18px 54px rgba(28, 78, 142, 0.13), inset 0 1px 0 var(--glass-line);
  --shadow-hover: 0 24px 70px rgba(28, 78, 142, 0.18), inset 0 1px 0 var(--glass-line);
  --button-shadow: 0 12px 24px rgba(24, 113, 255, 0.2);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

html {
  min-width: 320px;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(24, 113, 255, 0.1), rgba(15, 159, 149, 0.08) 46%, rgba(255, 255, 255, 0.62)),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 32, 51, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 32, 51, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 76%);
  content: "";
}

body.modal-open {
  overflow: hidden;
}

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

button,
a.button {
  -webkit-tap-highlight-color: transparent;
}

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

h1 {
  font-size: 20px;
  line-height: 1.15;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.fallback {
  width: min(560px, calc(100vw - 32px));
  margin: 80px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.12);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 34px rgba(28, 78, 142, 0.09);
  backdrop-filter: blur(18px) saturate(1.18);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  box-shadow: 0 12px 26px rgba(24, 113, 255, 0.28);
  font-weight: 800;
}

.brand-copy {
  min-width: 0;
}

.brand-copy p,
.eyebrow,
.muted-text,
.user-label {
  color: var(--muted);
}

.brand-copy p {
  max-width: 52vw;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.auth-actions,
.auth-panel-actions,
.profile-head,
.jobs-actions,
.job-tools,
.job-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-label {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(480px, 1.28fr);
  gap: 18px;
  width: min(1180px, calc(100vw - 32px));
  margin: 22px auto 34px;
}

.auth-panel,
.upload-panel,
.profile-panel,
.admin-panel,
.jobs-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.14);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.auth-panel:hover,
.upload-panel:hover,
.profile-panel:hover,
.admin-panel:hover,
.jobs-panel:hover {
  border-color: rgba(96, 141, 203, 0.5);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.side-column {
  display: grid;
  gap: 18px;
  align-self: start;
}

.auth-panel,
.upload-panel,
.profile-panel,
.admin-panel {
  align-self: start;
}

.auth-panel,
.upload-panel,
.profile-panel,
.admin-panel,
.jobs-panel {
  padding: 18px;
}

.jobs-panel {
  min-height: 360px;
}

.auth-panel {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(236, 255, 248, 0.66)),
    var(--surface);
}

.auth-panel-header {
  display: grid;
  gap: 2px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid rgba(161, 195, 239, 0.56);
  border-radius: 8px;
  padding: 4px;
  background: rgba(247, 251, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.segmented-control button {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.segmented-control button.active {
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(24, 113, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-feedback {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.auth-feedback.success {
  border: 1px solid #bde8de;
  background: rgba(239, 253, 249, 0.82);
  color: #087f74;
}

.auth-feedback.error {
  border: 1px solid rgba(241, 198, 198, 0.82);
  background: rgba(255, 247, 247, 0.86);
  color: var(--danger);
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary-strong);
  cursor: pointer;
  font-weight: 750;
}

.auth-links button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.social-login {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(185, 207, 232, 0.58);
  padding-top: 14px;
}

.social-login > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.social-login-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-login-buttons .button {
  flex: 1 1 120px;
}

.profile-panel,
.admin-panel {
  display: grid;
  gap: 16px;
}

.profile-panel .panel-heading,
.admin-panel .panel-heading {
  margin-bottom: 0;
}

.profile-head {
  gap: 12px;
  min-width: 0;
}

.avatar-preview {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(169, 201, 246, 0.68);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7e8, rgba(232, 251, 247, 0.92));
  color: var(--primary-strong);
  font-size: 22px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 22px rgba(28, 78, 142, 0.09);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview.small {
  width: 38px;
  height: 38px;
  font-size: 15px;
}

.profile-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-summary strong,
.admin-user-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.profile-summary span,
.admin-user-main span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.profile-form {
  display: grid;
  gap: 12px;
}

.tier-trial {
  background: #fff7e8;
  color: var(--warning);
}

.tier-paid {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.tier-full {
  background: rgba(232, 251, 247, 0.86);
  color: var(--teal);
}

.empty-state.compact {
  min-height: 120px;
}

.admin-users-list {
  display: grid;
  gap: 10px;
}

.worker-list {
  display: grid;
  gap: 10px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(126px, 150px);
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(225, 233, 245, 0.86);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.admin-user-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.worker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(225, 233, 245, 0.86);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.worker-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.worker-main strong,
.worker-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worker-main span {
  color: var(--muted);
  font-size: 12px;
}

.worker-meta {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.worker-meta dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.worker-meta dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.worker-kick-button {
  grid-column: 1 / -1;
  width: 100%;
}

.tier-select {
  min-width: 0;
}

.tier-select select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.button,
.icon-button,
.file-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 15px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.button svg,
.icon-button svg,
.file-picker svg,
.empty-state svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.button:hover,
.icon-button:hover,
.file-picker:hover {
  transform: translateY(-1px);
}

.button:disabled,
.icon-button:disabled,
.file-picker:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  transform: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), #0f8fff);
  color: #fff;
  box-shadow: var(--button-shadow);
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--primary-strong), #0679ec);
  box-shadow: 0 16px 30px rgba(24, 113, 255, 0.26);
}

.button.secondary,
.icon-button.light {
  border-color: rgba(161, 195, 239, 0.72);
  background: rgba(233, 242, 255, 0.78);
  color: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(24, 113, 255, 0.08);
}

.button.secondary:hover,
.icon-button.light:hover {
  background: rgba(220, 236, 255, 0.9);
  box-shadow: 0 12px 22px rgba(24, 113, 255, 0.13);
}

.button.ghost,
.icon-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(28, 78, 142, 0.06);
}

.button.ghost:hover,
.icon-button:hover {
  border-color: #b7cbe4;
  background: var(--surface-soft);
}

.icon-button.danger {
  border-color: rgba(241, 198, 198, 0.78);
  background: rgba(255, 247, 247, 0.84);
  color: var(--danger);
}

.icon-button.danger:hover {
  border-color: #e69a9a;
  background: rgba(255, 240, 240, 0.92);
  box-shadow: 0 12px 24px rgba(214, 66, 66, 0.13);
}

.button:focus-visible,
.icon-button:focus-visible,
.file-picker:focus-visible,
.segmented-control button:focus-visible,
.auth-links button:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible,
.tier-select select:focus-visible,
.viewer-select select:focus-visible {
  outline: 3px solid rgba(24, 113, 255, 0.18);
  outline-offset: 2px;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.state-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.state-pill.ok {
  background: rgba(232, 251, 247, 0.86);
  color: #087f74;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.compute-strip {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(169, 201, 246, 0.62);
  border-radius: 8px;
  padding: 12px;
  background: rgba(247, 251, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.compute-strip strong,
.compute-strip span {
  display: block;
  min-width: 0;
}

.compute-strip strong {
  font-size: 14px;
  line-height: 1.35;
}

.compute-strip span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.compute-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #0f8fff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(24, 113, 255, 0.2);
}

.compute-icon svg {
  width: 19px;
  height: 19px;
}

.compute-gpu {
  border-color: #bde8de;
  background: rgba(242, 255, 251, 0.78);
}

.compute-gpu .compute-icon {
  background: linear-gradient(135deg, var(--teal), #1871ff);
}

.compute-laptop {
  border-color: rgba(183, 203, 228, 0.82);
  background: rgba(255, 252, 244, 0.8);
}

.compute-laptop .compute-icon {
  background: linear-gradient(135deg, #0f9f95, #b7791f);
}

.upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.file-picker {
  width: 100%;
  min-height: 98px;
  border: 1px dashed #9fc0ec;
  background: rgba(248, 251, 255, 0.72);
  color: var(--text);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 24px rgba(28, 78, 142, 0.07);
}

.file-picker span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.field textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(24, 113, 255, 0.14);
}

.run-button {
  width: 100%;
}

.progress-track {
  height: 8px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 238, 247, 0.82);
  box-shadow: inset 0 1px 2px rgba(18, 32, 51, 0.08);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  transition: width 180ms ease;
}

.activity-log {
  display: grid;
  gap: 8px;
  min-height: 126px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(185, 207, 232, 0.68);
  border-radius: 8px;
  padding: 12px;
  background: rgba(251, 253, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.log-line {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.log-line time {
  color: var(--muted);
}

.log-line span {
  overflow-wrap: anywhere;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  border: 1px dashed rgba(159, 192, 236, 0.74);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(248, 251, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.empty-state svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.jobs-list {
  display: grid;
  gap: 12px;
}

.job-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(28, 78, 142, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.job-card:hover {
  border-color: rgba(96, 141, 203, 0.5);
  box-shadow: 0 18px 42px rgba(28, 78, 142, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
}

.job-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

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

.job-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.job-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.job-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 30px;
  border: 1px solid rgba(225, 233, 245, 0.86);
  border-radius: 8px;
  padding: 0 7px;
  color: var(--muted);
  background: rgba(251, 253, 255, 0.72);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.job-step svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.job-step span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-step.done {
  border-color: #bde8de;
  color: #087f74;
  background: rgba(239, 253, 249, 0.78);
}

.job-step.active {
  border-color: #a8c9f6;
  color: var(--primary-strong);
  background: rgba(233, 242, 255, 0.82);
  box-shadow: 0 8px 18px rgba(24, 113, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.job-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.job-meta div {
  min-width: 0;
}

.job-meta dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.job-meta dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.status-badge {
  background: rgba(238, 242, 247, 0.8);
  color: #475569;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.status-waiting-for-upload,
.status-queued,
.status-leased,
.status-submitting,
.status-submitted,
.status-starting,
.status-runnable {
  background: #fff7e8;
  color: var(--warning);
}

.status-running {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.worker-status-idle {
  background: rgba(232, 251, 247, 0.86);
  color: var(--teal);
}

.worker-status-busy {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.worker-status-offline,
.worker-status-draining {
  background: #fff7e8;
  color: var(--warning);
}

.worker-status-disabled {
  background: rgba(255, 240, 240, 0.86);
  color: var(--danger);
}

.status-succeeded {
  background: rgba(232, 251, 247, 0.86);
  color: var(--teal);
}

.status-failed,
.status-unknown {
  background: rgba(255, 240, 240, 0.86);
  color: var(--danger);
}

.job-footer {
  justify-content: flex-start;
  min-height: 40px;
}

.job-tools {
  flex: 0 0 auto;
}

.job-footer .icon-button {
  flex: 0 0 auto;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.result-button {
  flex: 0 0 auto;
}

.job-note {
  display: -webkit-box;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

.job-note-warning {
  color: var(--warning);
}

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

.muted-text {
  flex: 1 1 0;
  min-width: 0;
  font-size: 13px;
}

.load-more {
  width: 100%;
  margin-top: 14px;
}

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

.viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 32, 51, 0.42);
  backdrop-filter: blur(14px) saturate(1.05);
}

.viewer-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(217, 229, 244, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 30px 90px rgba(18, 32, 51, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(1.12);
}

.viewer-header,
.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
}

.viewer-header {
  border-bottom: 1px solid var(--line);
}

.viewer-header > div {
  min-width: 0;
}

.viewer-header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-stage {
  position: relative;
  min-height: 0;
  background: rgba(248, 251, 255, 0.76);
}

.ply-viewport {
  position: absolute;
  inset: 0;
}

.ply-viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.viewer-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(248, 251, 255, 0.82);
  backdrop-filter: blur(10px);
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}

.viewer-status.error {
  color: var(--danger);
}

.viewer-footer {
  border-top: 1px solid var(--line);
}

.viewer-footer > span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.viewer-select {
  min-width: 0;
  flex: 1 1 220px;
}

.viewer-select select {
  width: min(320px, 100%);
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 36px 0 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.viewer-select select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(24, 113, 255, 0.14);
}

.viewer-select select:disabled {
  opacity: 0.62;
}

@media (max-width: 880px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .brand-copy p {
    max-width: calc(100vw - 96px);
  }

  .auth-actions {
    width: 100%;
  }

  .user-label {
    max-width: 100%;
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    width: min(100vw - 24px, 740px);
    margin-top: 14px;
  }

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

  .job-meta dd {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 680px) {
  .viewer-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .viewer-sheet {
    width: 100%;
    height: min(86vh, 720px);
    max-height: calc(100vh - 20px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .viewer-header,
  .viewer-footer {
    padding: 14px;
  }

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

  .viewer-footer .button {
    width: 100%;
  }

  .viewer-select,
  .viewer-select select {
    width: 100%;
  }
}

@media (max-width: 520px) {
  h2 {
    font-size: 20px;
  }

  .auth-panel,
  .upload-panel,
  .profile-panel,
  .admin-panel,
  .jobs-panel {
    padding: 14px;
  }

  .button,
  .file-picker {
    width: 100%;
  }

  .auth-actions .button {
    width: auto;
    flex: 1 1 120px;
  }

  .panel-heading,
  .job-main,
  .job-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .job-steps,
  .job-meta {
    grid-template-columns: 1fr;
  }

  .job-tools {
    width: 100%;
  }

  .profile-head {
    align-items: flex-start;
  }

  .admin-user-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .worker-row,
  .worker-meta {
    grid-template-columns: 1fr;
  }

  .tier-select {
    grid-column: 1 / -1;
  }

  .result-button {
    margin-left: 0;
  }

  .result-actions {
    width: 100%;
    margin-left: 0;
  }

  .result-actions .button {
    width: auto;
    flex: 1 1 150px;
  }

  .job-note,
  .muted-text {
    flex-basis: auto;
    width: 100%;
  }

  .log-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
