:root {
  --bg: #cfd3d8;
  --bg-deep: #aeb4bc;
  --surface: rgba(245, 246, 248, 0.9);
  --surface-strong: #d9dde2;
  --surface-dark: #8b929b;
  --text: #1e2329;
  --muted: #59616b;
  --accent: #4f5660;
  --accent-strong: #2f353d;
  --border: #9098a1;
  --shadow: 0 14px 32px rgba(34, 40, 46, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Bahnschrift", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-size: 24px 24px, 24px 24px, cover;
}

a {
  color: inherit;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.14)),
    linear-gradient(180deg, rgba(233, 236, 239, 0.96), rgba(212, 217, 223, 0.92));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(47, 53, 61, 0.18);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent-strong);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 4.6vw, 4.6rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 10px;
  max-width: min(16ch, 100%);
}

.assignment-title {
  max-width: min(22ch, 100%);
  line-height: 1.02;
}

.card h2,
.panel h2,
.hero h2 {
  line-height: 1.08;
}

.lead {
  max-width: 72ch;
  margin: 18px 0 0;
  line-height: 1.7;
  color: var(--muted);
}

.button-row,
.nav-grid,
.card-grid {
  display: grid;
  gap: 16px;
}

.button-row {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 4px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  box-shadow: inset 0 -2px 0 rgba(47, 53, 61, 0.12);
}

.button.primary {
  background: linear-gradient(180deg, #656d77 0%, #49515a 100%);
  border-color: #454c54;
  color: #f8f9fa;
}

.section {
  margin-top: 28px;
}

.nav-grid,
.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  padding: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(248, 249, 250, 0.92), rgba(229, 232, 235, 0.88));
  box-shadow: var(--shadow);
}

.card p,
.panel p,
.panel li {
  color: var(--muted);
  line-height: 1.65;
}

.card a {
  text-decoration: none;
}

.panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(244, 246, 247, 0.94), rgba(221, 225, 229, 0.9));
  box-shadow: var(--shadow);
}

.panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.js-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 20px;
}

.react-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 20px;
}

.spa-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.oojs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(320px, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.js-side-panel {
  margin-top: 0;
  align-self: start;
}

.react-side-panel {
  margin-top: 0;
  align-self: start;
}

.spa-side-panel {
  margin-top: 0;
  align-self: start;
}

.oojs-side-panel {
  margin-top: 0;
  align-self: start;
}

.js-toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.react-toolbar-panel {
  display: grid;
  gap: 20px;
}

.react-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: end;
}

.spa-route-bar,
.spa-section-heading,
.spa-group-header,
.oojs-toolbar,
.oojs-section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.toolbar-actions {
  display: flex;
  justify-content: flex-start;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-label,
.summary-label {
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

.text-input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font: inherit;
}

.text-input:focus {
  outline: 2px solid rgba(79, 86, 96, 0.24);
  outline-offset: 0;
  border-color: var(--accent);
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.form-actions {
  display: grid;
  gap: 12px;
}

.captcha-box {
  padding: 14px 16px;
  border: 1px dashed rgba(69, 76, 84, 0.46);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

.captcha-box__question,
.captcha-box__hint {
  margin: 0;
}

.captcha-box__question {
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.captcha-box__hint {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.summary-card {
  min-height: 156px;
}

.react-insight,
.react-note {
  padding: 18px;
  border-radius: 6px;
  border: 1px solid rgba(144, 152, 161, 0.5);
  background: rgba(255, 255, 255, 0.56);
}

.react-insight strong {
  display: block;
  margin-top: 12px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spa-main {
  display: grid;
  gap: 20px;
}

.oojs-main {
  display: grid;
  gap: 20px;
}

.spa-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.oojs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.spa-software-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.oojs-software-card {
  display: grid;
  gap: 14px;
  align-content: start;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.oojs-software-card:hover {
  transform: translateY(-2px);
}

.oojs-software-card.is-selected {
  border-color: #454c54;
  box-shadow: inset 0 0 0 1px rgba(47, 53, 61, 0.18), var(--shadow);
}

.oojs-software-card h3 {
  font-size: 1.15rem;
}

.spa-software-card.is-selected {
  border-color: #454c54;
  box-shadow: inset 0 0 0 1px rgba(47, 53, 61, 0.18), var(--shadow);
}

.spa-software-card h3 {
  font-size: 1.2rem;
}

.spa-selected-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.spa-selected-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid rgba(144, 152, 161, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.54);
}

.oojs-mode-grid {
  display: grid;
  gap: 12px;
}

.oojs-mode-button {
  justify-content: flex-start;
  text-align: left;
  min-height: 76px;
  padding: 14px 16px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.oojs-mode-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.oojs-mode-button span {
  color: var(--muted);
  line-height: 1.5;
}

.oojs-mode-button.is-active {
  background: linear-gradient(180deg, #656d77 0%, #49515a 100%);
  border-color: #454c54;
  color: #f8f9fa;
}

.oojs-mode-button.is-active span {
  color: rgba(248, 249, 250, 0.86);
}

.oojs-selection-list,
.oojs-log-list {
  display: grid;
  gap: 12px;
}

.oojs-selection-item,
.oojs-log-entry {
  padding: 14px;
  border: 1px solid rgba(144, 152, 161, 0.5);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.54);
}

.oojs-selection-item {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.oojs-selection-item p,
.oojs-log-entry p {
  margin: 4px 0 0;
}

.oojs-log-entry strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  color: var(--accent-strong);
}

.oojs-floating-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(280px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid rgba(69, 76, 84, 0.72);
  border-radius: 6px;
  background: rgba(47, 53, 61, 0.9);
  color: #f8f9fa;
  box-shadow: 0 16px 30px rgba(34, 40, 46, 0.22);
}

.oojs-floating-status p {
  margin: 4px 0 0;
  color: rgba(248, 249, 250, 0.82);
  line-height: 1.5;
}

.oojs-floating-status strong {
  display: block;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.oojs-preview {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(144, 152, 161, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
  font-family: "Consolas", "Courier New", monospace;
}

.spa-selected-item p {
  margin: 4px 0 0;
}

.spa-group + .spa-group {
  margin-top: 18px;
}

.spa-preview {
  margin: 18px 0 0;
  padding: 16px;
  border: 1px solid rgba(144, 152, 161, 0.45);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.6;
  font-family: "Consolas", "Courier New", monospace;
}

.spa-textarea {
  min-height: 132px;
  padding: 14px;
  resize: vertical;
}

.summary-value {
  display: block;
  margin-top: 14px;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(144, 152, 161, 0.4);
  text-align: left;
  vertical-align: middle;
}

.data-table thead th {
  background: rgba(47, 53, 61, 0.08);
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr.is-selected {
  background: rgba(79, 86, 96, 0.12);
}

.table-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  background: rgba(89, 97, 107, 0.14);
  border: 1px solid rgba(89, 97, 107, 0.24);
  font-size: 0.9rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.chip-button.is-active {
  background: linear-gradient(180deg, #656d77 0%, #49515a 100%);
  border-color: #454c54;
  color: #f8f9fa;
}

.mini-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.mini-button.danger {
  border-color: #8b5c5c;
  color: #6f2d2d;
}

.muted-line {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.empty-state-box {
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.back-link {
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-shell__header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  background: rgba(207, 211, 216, 0.76);
  border-bottom: 1px solid rgba(144, 152, 161, 0.38);
}

.site-shell__header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-shell__brand-block {
  min-width: 0;
}

.site-shell__eyebrow {
  margin-bottom: 8px;
}

.site-shell__brand {
  display: block;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-shell__header-tools {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.site-shell__main {
  padding-top: 28px;
}

.header-user-card {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 10px;
  align-items: center;
  max-width: min(100%, 36rem);
  padding: 10px 14px;
  border: 1px solid rgba(69, 76, 84, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.header-user-card__label {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.header-user-card__value {
  color: var(--text);
  line-height: 1.4;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.56);
}

.site-nav__link.is-active {
  background: linear-gradient(180deg, #656d77 0%, #49515a 100%);
  border-color: #454c54;
  color: #f8f9fa;
}

.flash {
  margin-top: 20px;
}

.flash--success {
  border-color: #5a8b66;
}

.flash--error {
  border-color: #9a6262;
}

.auth-grid,
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 28px;
}

.media-card,
.map-card {
  overflow: hidden;
}

.embedded-media {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 1px solid rgba(144, 152, 161, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.embedded-media--frame,
.embedded-media--map {
  border: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.gallery-card {
  display: grid;
  gap: 12px;
}

.gallery-card__trigger {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(144, 152, 161, 0.4);
  background: rgba(255, 255, 255, 0.6);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-card__trigger:hover .gallery-card__image,
.gallery-card__trigger:focus-visible .gallery-card__image {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(34, 40, 46, 0.18);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 27, 31, 0.82);
  backdrop-filter: blur(4px);
}

.gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(31, 36, 42, 0.96);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
}

.gallery-lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f6f8;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.gallery-lightbox__figure {
  margin: 0;
  display: grid;
  gap: 14px;
}

.gallery-lightbox__image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.gallery-lightbox__caption {
  display: grid;
  gap: 6px;
  padding: 0 6px 4px;
}

.gallery-lightbox__title {
  color: #f4f6f8;
  font-size: 1.05rem;
  line-height: 1.4;
}

.gallery-lightbox__meta {
  color: rgba(244, 246, 248, 0.78);
  line-height: 1.55;
}

body.has-gallery-lightbox {
  overflow: hidden;
}

.validation-box {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid #9a6262;
  background: rgba(255, 245, 245, 0.84);
}

.validation-box ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.contact-textarea {
  min-height: 180px;
  padding: 14px;
  resize: vertical;
}

.muted-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

.iframe-shell {
  border: 1px solid rgba(144, 152, 161, 0.5);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.48);
}

.crud-frame {
  width: 100%;
  min-height: 1200px;
  border: 0;
  background: #ffffff;
}

.site-footer {
  padding: 0 0 32px;
}

.site-footer__inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(244, 246, 247, 0.82);
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}

.site-footer__inner p {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.placeholder {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
}

.placeholder strong {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

code {
  font-family: "Consolas", "Courier New", monospace;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1120px);
    padding-top: 20px;
  }

  .hero,
  .panel,
  .card {
    padding: 20px;
  }

  .embedded-media {
    min-height: 240px;
  }

  .crud-frame {
    min-height: 960px;
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox__dialog {
    width: min(100%, calc(100vw - 24px));
    padding: 14px 14px 12px;
  }

  .gallery-lightbox__image {
    max-height: calc(100vh - 150px);
  }
}

@media (max-width: 920px) {
  .js-layout,
  .react-layout,
  .spa-layout,
  .oojs-layout,
  .react-toolbar {
    grid-template-columns: 1fr;
  }

  .site-shell__header-inner {
    grid-template-columns: 1fr;
  }

  .site-shell__header-tools {
    justify-items: stretch;
  }

  .header-user-card,
  .site-nav__list {
    justify-content: flex-start;
  }
}
