:root {
  color-scheme: light;
  --paper: #faf9f5;
  --panel: #f2f0e8;
  --forest: #233c2d;
  --line: #dad8cd;
  color: var(--forest);
  font-family: "Inter", "Segoe UI", sans-serif;
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
.layout { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 24% minmax(0, 1fr); overflow: hidden; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: clamp(18px, 2vw, 40px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 14px; padding: 8px 0 29px; border-bottom: 1px solid var(--line); }
.brand strong { display: block; font-size: clamp(21px, 2vw, 32px); letter-spacing: -.045em; font-weight: 620; }
.brand small { display: block; font-size: 13px; color: #586657; margin-top: 3px; }
.mark { position: relative; flex: 0 0 42px; height: 45px; background: var(--forest); border-radius: 11px; }
.mark::before, .mark::after { content: ""; position: absolute; background: #e7e8cc; width: 11px; height: 20px; border-radius: 100% 0; left: 12px; top: 17px; transform: rotate(-48deg); }
.mark::after { left: 22px; top: 8px; transform: rotate(6deg); }
nav { display: grid; gap: 5px; padding-top: 28px; }
nav a { min-height: 49px; padding: 11px clamp(10px, 1.15vw, 20px); display: flex; align-items: center; gap: 11px; color: var(--forest); text-decoration: none; border-radius: 10px; font-size: clamp(14px, 1.08vw, 18px); font-weight: 500; line-height: 1.35; }
nav a:hover { background: #e6e6da; }
nav a[aria-current] { background: var(--forest); color: white; }
nav svg { width: 20px; height: 20px; flex-shrink: 0; }
:focus-visible { outline: 3px solid #818a47; outline-offset: 2px; }
main { overflow-y: auto; min-height: 0; padding: 16px clamp(25px, 3.9vw, 76px); }
.frame { position: relative; isolation: isolate; container-type: inline-size; aspect-ratio: 16 / 9; width: 100%; overflow: hidden; background: #e6e6d9; border: 1px solid #d8d8c9; border-radius: 20px; }
/* Тонкий рельеф обложки сделан в CSS. Для реальной демонстрации фон закрывает сам компонент. */
.frame::before { content: ""; z-index: -1; position: absolute; width: 71%; aspect-ratio: 1; right: -34%; top: -61%; border-radius: 42% 58% 48% 52%; transform: rotate(28deg); border: 1px solid #a6ad924f;
  box-shadow: 0 0 0 20px #e6e6d9, 0 0 0 21px #bdc2aa, 0 0 0 43px #e6e6d9, 0 0 0 44px #c2c6b0, 0 0 0 69px #e6e6d9, 0 0 0 70px #c5cab4, 0 0 0 100px #e6e6d9, 0 0 0 101px #cbcdb9, 0 0 0 137px #e6e6d9, 0 0 0 138px #ced1c0, 0 0 0 180px #e6e6d9, 0 0 0 181px #d4d6c6; }
#content { width: 100%; height: 100%; display: grid; align-items: end; }
h1 { margin: 0; padding: 0 10% 6.5% 6.5%; font-size: clamp(23px, 8.3cqw, 116px); line-height: 1.06; font-weight: 540; letter-spacing: -.055em; overflow-wrap: anywhere; }
.frame :is(img, video) { width: 100%; height: 100%; display: block; object-fit: contain; }
#expand { position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #c2c5b6; background: #f8f7f0; color: var(--forest); cursor: pointer; }
#expand:hover { background: white; }
#expand[hidden] { display: none; }
#expand svg { width: 19px; }
.frame:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
#expanded-view { inset: 0; margin: 0; padding: 0; border: 0; width: 100%; max-width: none; height: 100%; max-height: none; color: inherit; background: var(--panel); }
#expanded-view .frame { height: 100%; border: 0; border-radius: 0; }
.site-viewer { display: grid; grid-template-rows: 54px minmax(0, 1fr); height: 100%; min-height: 0; background: var(--paper); }
.site-viewer h1 { display: flex; align-items: center; padding: 0 62px 0 20px; font-size: 16px; letter-spacing: -.02em; border-bottom: 1px solid var(--line); }
.site-viewer iframe { display: block; border: 0; width: 100%; height: 100%; }
.frame:has(.site-viewer) #expand { top: 5px; right: 8px; }
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  aside { overflow: hidden; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0 8px; }
  .brand { padding: 0 16px 10px; border: 0; gap: 9px; }
  .mark { transform: scale(.72); transform-origin: left center; margin-right: -10px; }
  .brand strong { font-size: 20px; }
  .brand small { font-size: 12px; margin-top: 0; }
  nav { display: flex; overflow-x: auto; padding: 4px 16px; gap: 4px; scrollbar-width: thin; }
  nav a { flex: none; min-height: 44px; padding: 9px 12px; }
  main { padding: 16px; }
  .frame { border-radius: 14px; }
  #expand { right: 9px; top: 9px; }
}

/* Встроенные сайт и CRM занимают всю доступную высоту рабочей области. */
#workspace > .frame:has(.site-viewer):not(:fullscreen) {
  aspect-ratio: auto;
  height: 100%;
  min-height: 360px;
}
