:root {
  color-scheme: light;
  font-family: 'Segoe UI', Arial, sans-serif;
  --login-bg-image: url('/static/genis_background.webp');
  --brand-red: #e11d48;
  --brand-blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
  color: #e5e7eb;
  position: relative;
}

.login-screen-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(180deg, rgba(2, 6, 23, 0.35), rgba(2, 6, 23, 0.8)),
    linear-gradient(90deg, rgba(2, 6, 23, 0.35) 0%, rgba(2, 6, 23, 0.65) 60%, rgba(2, 6, 23, 0.82) 100%),
    var(--login-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-screen-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0 50%, rgba(2, 6, 23, 0.45) 50% 100%);
}

.app-header {
  padding: 18px 24px 0;
  text-align: center;
}

.app-header__title {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: #f9fafb;
  text-transform: uppercase;
  font-weight: 600;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 36px;
}

.auth-card {
  width: min(440px, calc(100vw - 48px));
  margin: clamp(24px, 10vh, 120px) auto 0;
}

.card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.35);
  backdrop-filter: blur(6px);
}

.slim-collapsible {
  padding: 10px 14px;
}

.slim-collapsible > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.slim-collapsible > summary::-webkit-details-marker {
  display: none;
}

.slim-collapsible > summary::before {
  content: '▸';
  margin-right: 8px;
}

.slim-collapsible[open] > summary::before {
  content: '▾';
}

.details-content {
  margin-top: 12px;
}

.logo-slot {
  height: 96px;
  border: 1px dashed rgba(255, 255, 255, 0.38);
  border-radius: 10px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
}

.logo-slot__img {
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: #f9fafb;
}

textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin: 8px 0 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

button {
  width: 100%;
  background: linear-gradient(180deg, #f43f5e, var(--brand-red));
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.3px;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.logs {
  background: rgba(2, 6, 23, 0.85);
  color: #d1fae5;
  padding: 10px;
  border-radius: 6px;
  min-height: 120px;
  overflow: auto;
}

.list {
  margin: 0;
  padding-left: 18px;
}

.muted {
  color: #cbd5e1;
}

.badge {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  color: #fff;
}

.status-queued {
  background: #6b7280;
}

.status-running {
  background: var(--brand-blue);
}

.status-failed {
  background: #b91c1c;
}

.status-done {
  background: #047857;
}

input[type='file'] {
  display: block;
  width: 100%;
  margin: 8px 0 12px;
}

#blok3-upload-result,
#blok4-upload-result,
#blok9-upload-result,
#blok10-upload-result,
#create-user-result {
  margin-top: 8px;
  word-break: break-word;
}

.link-btn {
  width: auto;
  background: transparent;
  color: #93c5fd;
  padding: 0;
  border: 0;
  text-decoration: underline;
  font-weight: 400;
}

.link-btn:disabled {
  color: #93c5fd;
}

input[type='text'],
input[type='password'],
select,
textarea {
  width: 100%;
  margin: 8px 0 12px;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.65);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.45);
  color: #f8fafc;
}

input[type='text']:focus,
input[type='password']:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.85);
  outline-offset: 1px;
}

.hidden {
  display: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar button {
  width: auto;
}


.auth-user-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
}


.stack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.blok-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.blok-files-header h3 {
  margin: 0;
}

#blok3-search,
#blok4-search,
#blok9-search,
#blok10-search {
  width: min(360px, 100%);
  margin: 0;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.file-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.file-card__name {
  margin: 0;
  font-size: 15px;
  word-break: break-word;
}

.file-card__size {
  font-size: 12px;
  white-space: nowrap;
}

.file-card__actions {
  align-items: center;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.preview-dialog {
  width: min(960px, 96vw);
  max-height: 90vh;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 12px;
  padding: 0;
  background: #0f172a;
  color: #e5e7eb;
}

.preview-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.preview-dialog__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.preview-dialog__close {
  width: auto;
  padding: 8px 10px;
}

.preview-dialog__body {
  padding: 12px;
  max-height: calc(90vh - 64px);
  overflow: auto;
}

.preview-frame {
  width: 100%;
  height: min(72vh, 900px);
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.preview-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.preview-svg {
  background: #fff;
  padding: 10px;
  border-radius: 8px;
}

.preview-svg svg {
  width: 100%;
  height: auto;
}


.stack-item {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.4);
}

.stack-item > summary {
  cursor: pointer;
}

.inline-form {
  margin-top: 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button {
  width: auto;
}

#auth-message {
  margin-top: 8px;
  color: #fecaca;
}

#app-content {
  margin-top: 24px;
}

@media (max-width: 720px) {
  .app-header__title {
    font-size: 14px;
    line-height: 1.3;
  }

  .container {
    padding: 16px;
  }

  .auth-card {
    width: 100%;
    margin-top: 20px;
  }
}