﻿.app-shell {
  --app-gutter-balance-offset: 5px;
  --app-shell-inline-padding: 28px;
  --app-shell-block-end-padding: 28px;
  --scene-heading-height: 54px;
  padding: var(--scene-heading-height) calc(var(--app-shell-inline-padding) - var(--app-gutter-balance-offset)) var(--app-shell-block-end-padding) calc(var(--app-shell-inline-padding) + var(--app-gutter-balance-offset));
}
.scene-shell {
  --scene-width: 1600px;
  display: flex;
  flex-direction: column;
  width: min(var(--scene-width), 100%);
  min-height: calc(100vh - var(--scene-heading-height) - var(--app-shell-block-end-padding));
  margin: 0 auto;
}
.scene-shell--entering {
  animation: scene-shell-enter 280ms ease-out both;
}
@keyframes scene-shell-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
.scene-content {
  width: min(var(--content-width), 100%);
  margin: 0 auto;
}
.scene-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
  text-align: center;
}

.scene-title {
  max-width: 100%;
  margin: 0;
  font-size: clamp(18px, 3vw, 32px);
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--text);
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.38);
  overflow-wrap: break-word;
  word-break: normal;
  text-align: center;
}
.scene-heading {
  --scene-heading-edge-offset: 24px;
  --scene-heading-control-width: 142px;
  --scene-heading-side-space: max(
    var(--scene-back-button-min-width),
    var(--scene-heading-control-width)
  );
  --scene-back-button-min-width: 120px;
  position: fixed;
  top: 0;
  left: calc(var(--scene-heading-edge-offset) + var(--app-gutter-balance-offset));
  right: calc(var(--scene-heading-edge-offset) - var(--app-gutter-balance-offset));
  z-index: 50;
  display: grid;
  grid-template-columns: var(--scene-heading-side-space) 1fr var(--scene-heading-side-space);
  align-items: center;
  gap: 12px;
  min-height: var(--scene-heading-height);
  margin: 0;
  padding: 0 28px 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
}
.scene-back-button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid rgba(72, 103, 120, 0.48);
  border-radius: var(--radius-card);
  background: #263f4d;
  color: #f7fbff;
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: var(--interactive-transition);
}
.scene-back-button:hover,
.scene-back-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft-hover), 0 7px 14px rgba(61, 96, 128, 0.12);
  filter: var(--interactive-hover-filter);
}
.scene-back-button--disabled,
.scene-back-button:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
  pointer-events: none;
}
.scene-back-button--disabled:hover,
.scene-back-button--disabled:focus-visible,
.scene-back-button:disabled:hover,
.scene-back-button:disabled:focus-visible {
  transform: none;
  box-shadow: none;
  filter: none;
}
.scene-heading-spacer {
  width: 100%;
  visibility: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.scene-legal-footer {
  margin: auto auto 0;
  padding-top: 50px;
  color: var(--text-soft);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .scene-shell--entering { animation: none; }
}
.scene-legal-footer a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-layout {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 40px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow-soft), 0 18px 38px rgba(61, 96, 128, 0.08);
}
.legal-article {
  max-width: 820px;
}
@media (max-width: 680px) {
  .app-shell {
    --app-gutter-balance-offset: 0px;
    --app-shell-inline-padding: 16px;
    --app-shell-block-end-padding: 16px;
    --scene-heading-height: 50px;
    padding: var(--scene-heading-height) calc(var(--app-shell-inline-padding) - var(--app-gutter-balance-offset)) var(--app-shell-block-end-padding) calc(var(--app-shell-inline-padding) + var(--app-gutter-balance-offset));
  }

  .scene-title {
    font-size: 18px;
  }

  .scene-heading {
    --scene-heading-edge-offset: 16px;
    --scene-back-button-min-width: 30px;
    --scene-heading-control-width: 30px;
    gap: 8px;
    padding: 10px 14px;
  }

  .scene-back-button {
    width: var(--scene-back-button-min-width);
    height: var(--scene-back-button-min-width);
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    font-size: 10px;
  }

  .scene-back-label {
    display: none;
  }
}
@media (max-width: 368px) {
  .scene-heading {
    position: absolute;
  }
}
