:root {
  --modal-open-dur: 250ms;
  --modal-close-dur: 150ms;
  --modal-scale: 0.96;
  --modal-scale-close: 0.96;
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.t-modal {
  transform-origin: center;
  transform: scale(var(--modal-scale));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-open-dur) var(--modal-ease),
    opacity   var(--modal-open-dur) var(--modal-ease);
  will-change: transform, opacity;
}
.t-modal.is-open {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.t-modal.is-closing {
  transform: scale(var(--modal-scale-close));
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--modal-close-dur) var(--modal-ease),
    opacity   var(--modal-close-dur) var(--modal-ease);
}

@media (prefers-reduced-motion: reduce) {
  .t-modal { transition: none !important; }
}

.hyd-sheet-workspace {
  width: min(96vw, 1680px);
  height: min(92dvh, 1080px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  color: #f2f5ff;
  background: transparent;
  border: 0;
}

.hyd-sheet-workspace[open] {
  display: block;
}

.hyd-sheet-workspace::backdrop {
  background: rgba(3, 7, 20, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  backdrop-filter: blur(12px) saturate(115%);
  opacity: 1;
  transition: opacity var(--modal-close-dur) var(--modal-ease);
}

.hyd-sheet-workspace.is-leaving::backdrop {
  opacity: 0;
}

.hyd-sheet-workspace.is-expanded {
  width: 100dvw;
  height: 100dvh;
}

.hyd-sheet-workspace__surface {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: #f2f5ff;
  background:
    linear-gradient(180deg, rgba(28, 40, 80, 0.48), transparent 88px),
    #0b1224;
  border: 1px solid rgba(102, 127, 255, 0.28);
  border-radius: 24px;
  box-shadow:
    0 32px 96px rgba(0, 0, 0, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.09);
  outline: none;
}

.hyd-sheet-workspace.is-expanded .hyd-sheet-workspace__surface {
  border: 0;
  border-radius: 0;
}

.hyd-sheet-workspace__bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 18px;
  padding: 12px 14px 12px 18px;
  background: rgba(11, 18, 36, 0.96);
  border-bottom: 1px solid rgba(102, 127, 255, 0.18);
}

.hyd-sheet-workspace__identity,
.hyd-sheet-workspace__actions {
  display: flex;
  align-items: center;
}

.hyd-sheet-workspace__identity {
  min-width: 0;
  gap: 12px;
}

.hyd-sheet-workspace__actions {
  flex: 0 0 auto;
  gap: 8px;
}

.hyd-sheet-workspace__mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #8aa0ff;
  background: #111b37;
  border: 1px solid rgba(111, 137, 255, 0.28);
  border-radius: 12px;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hyd-sheet-workspace__mark svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.6;
}

.hyd-sheet-workspace__heading {
  min-width: 0;
}

.hyd-sheet-workspace__heading h2,
.hyd-sheet-workspace__heading p {
  overflow: hidden;
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hyd-sheet-workspace__heading h2 {
  color: #f5f7ff;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.hyd-sheet-workspace__heading p {
  margin-top: 3px;
  color: #9ba7cb;
  font-size: 12px;
  line-height: 1.3;
}

.hyd-sheet-workspace__status,
.hyd-sheet-workspace__tool,
.hyd-sheet-workspace__close {
  min-height: 40px;
  border-radius: 11px;
}

.hyd-sheet-workspace__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #aeb8d7;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.hyd-sheet-workspace__status-dot {
  width: 7px;
  height: 7px;
  background: #f6c65b;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(246, 198, 91, 0.11);
}

.hyd-sheet-workspace__status.is-ready {
  color: #b8f4e2;
}

.hyd-sheet-workspace__status.is-ready .hyd-sheet-workspace__status-dot {
  background: #1fd6a2;
  box-shadow: 0 0 0 4px rgba(31, 214, 162, 0.12);
}

.hyd-sheet-workspace__tool,
.hyd-sheet-workspace__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dce3fb;
  background: #111a32;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 4px 13px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    color 150ms ease,
    background-color 150ms ease,
    border-color 150ms ease,
    transform 80ms ease;
}

.hyd-sheet-workspace__tool {
  gap: 7px;
  padding: 0 12px;
}

.hyd-sheet-workspace__close {
  width: 40px;
  padding: 0;
}

.hyd-sheet-workspace__tool:hover,
.hyd-sheet-workspace__close:hover {
  color: #ffffff;
  background: #182344;
  border-color: rgba(118, 143, 255, 0.45);
}

.hyd-sheet-workspace__tool:active,
.hyd-sheet-workspace__close:active {
  transform: scale(0.97);
}

.hyd-sheet-workspace__tool:focus-visible,
.hyd-sheet-workspace__close:focus-visible {
  outline: 3px solid rgba(95, 221, 184, 0.88);
  outline-offset: 2px;
}

.hyd-sheet-workspace__tool svg,
.hyd-sheet-workspace__close svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hyd-sheet-workspace__zoom {
  display: inline-grid;
  grid-template-columns: 40px minmax(58px, auto) 40px;
  flex: 0 0 auto;
  height: 40px;
  overflow: hidden;
  background: #111a32;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  box-shadow:
    0 4px 13px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.hyd-sheet-workspace__zoom-button {
  display: grid;
  min-width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
  color: #dce3fb;
  background: transparent;
  border: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.hyd-sheet-workspace__zoom-button + .hyd-sheet-workspace__zoom-button {
  border-left: 1px solid rgba(255, 255, 255, 0.09);
}

.hyd-sheet-workspace__zoom-button:hover:not(:disabled) {
  color: #ffffff;
  background: #182344;
}

.hyd-sheet-workspace__zoom-button:active:not(:disabled) {
  background: #202d52;
}

.hyd-sheet-workspace__zoom-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(95, 221, 184, 0.88);
  outline-offset: -3px;
}

.hyd-sheet-workspace__zoom-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.hyd-sheet-workspace__zoom-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.hyd-sheet-workspace__zoom-reset {
  min-width: 58px;
  padding: 0 9px;
}

.hyd-sheet-workspace__zoom-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hyd-sheet-workspace__restore-icon {
  display: none;
}

.hyd-sheet-workspace.is-expanded .hyd-sheet-workspace__expand-icon {
  display: none;
}

.hyd-sheet-workspace.is-expanded .hyd-sheet-workspace__restore-icon {
  display: block;
}

.hyd-sheet-workspace__viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f7f8fc;
}

.hyd-sheet-workspace__viewport iframe {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 100%;
  height: 100%;
  /* Astra and several page builders cap embedded media at 100% width.
     The workspace deliberately gives the frame inverse dimensions before
     scaling it, so that cap would leave a blank strip at zooms below 100%. */
  max-width: none !important;
  max-height: none !important;
  background: #ffffff;
  border: 0;
  transform: scale(1);
  transform-origin: 0 0;
}

.hyd-sheet-workspace__loading {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 24px;
  color: #52607d;
  background: #f7f8fc;
  text-align: center;
  transition:
    opacity 180ms var(--modal-ease),
    visibility 180ms var(--modal-ease);
}

.hyd-sheet-workspace__loading strong {
  color: #17213a;
  font-size: 15px;
  line-height: 1.3;
}

.hyd-sheet-workspace__loading > span:last-child {
  max-width: 48ch;
  font-size: 12px;
  line-height: 1.55;
}

.hyd-sheet-workspace__loading.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.hyd-sheet-workspace__loader {
  width: 26px;
  height: 26px;
  margin-bottom: 5px;
  border: 2px solid rgba(79, 111, 255, 0.18);
  border-top-color: #4f6fff;
  border-radius: 50%;
  animation: hyd-sheet-spin 700ms linear infinite;
}

@keyframes hyd-sheet-spin {
  to { transform: rotate(360deg); }
}

.hyd-sheet-trigger {
  cursor: pointer;
}

.hyd-sheet-trigger__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hyd-sheet-trigger__icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 150ms var(--modal-ease);
}

.hyd-sheet-trigger:hover .hyd-sheet-trigger__icon,
.hyd-sheet-trigger:focus-visible .hyd-sheet-trigger__icon {
  transform: translateX(3px);
}

.hyd-sheet-trigger .plan-link,
.plan-link.hyd-sheet-trigger {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.hyd-sheet-trigger .plan-link::before,
.plan-link.hyd-sheet-trigger::before {
  position: absolute;
  z-index: -1;
  inset: 1px;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  pointer-events: none;
}

.hyd-sheet-trigger:focus-visible,
.hyd-sheet-trigger .plan-link:focus-visible,
.plan-link.hyd-sheet-trigger:focus-visible {
  outline: 3px solid rgba(95, 221, 184, 0.88);
  outline-offset: 4px;
}

@media (max-width: 860px), (pointer: coarse) {
  .hyd-sheet-workspace__zoom {
    grid-template-columns: 44px minmax(58px, auto) 44px;
    height: 44px;
  }

  .hyd-sheet-workspace__zoom-button {
    min-width: 44px;
    height: 44px;
  }
}

@media (max-width: 860px) {
  .hyd-sheet-workspace {
    width: 100dvw;
    height: 100dvh;
  }

  .hyd-sheet-workspace__surface {
    border: 0;
    border-radius: 0;
  }

  .hyd-sheet-workspace__bar {
    min-height: 64px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px 12px;
  }

  .hyd-sheet-workspace__mark,
  .hyd-sheet-workspace__status,
  .hyd-sheet-workspace__expand {
    display: none;
  }

  .hyd-sheet-workspace__heading h2 {
    max-width: 38vw;
  }

  .hyd-sheet-workspace__heading p {
    display: none;
  }

  .hyd-sheet-workspace__external span {
    display: none;
  }

  .hyd-sheet-workspace__external {
    width: 40px;
    padding: 0;
  }
}

@media (max-width: 560px) {
  .hyd-sheet-workspace__bar {
    min-height: 116px;
    padding-bottom: 60px;
  }

  .hyd-sheet-workspace__zoom {
    position: absolute;
    right: max(10px, env(safe-area-inset-right));
    bottom: 8px;
    left: max(12px, env(safe-area-inset-left));
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hyd-sheet-workspace::backdrop,
  .hyd-sheet-workspace__loading,
  .hyd-sheet-workspace__tool,
  .hyd-sheet-workspace__close {
    transition: none !important;
  }

  .hyd-sheet-workspace__loader {
    animation-duration: 1400ms;
  }

  .hyd-sheet-trigger__icon {
    transition: none !important;
  }
}
