:root {
  --phins-ink: #0f172a;
  --phins-muted: #64748b;
  --phins-primary: #0369a1;
  --phins-primary-hover: #075985;
  --phins-surface: #f8fafc;
  --phins-dialog-ink: #0f172a;
  --phins-dialog-muted: #475569;
  --phins-dialog-border: #cbd5e1;
  --phins-dialog-surface: #f8fafc;
  --phins-dialog-canvas: #eef2f7;
  --phins-dialog-surface-hover: #e0f2fe;
  --phins-dialog-accent: #0369a1;
  --phins-dialog-primary-soft: #e0f2fe;
  --phins-dialog-success-soft: #dcfce7;
  --phins-dialog-error: #b91c1c;
  --phins-dialog-warning: #92400e;
  --phins-dialog-success: #166534;
}

html,
body {
  overscroll-behavior: none;
}

/* draw.io 31.3.2 only assigns the native palette wrapper as a scroll owner
 * when .geSidebarFooter exists. PHINs intentionally omits that footer before
 * first paint, so the no-footer variant must consume the full grid row and
 * own vertical overflow itself. Keep this limited to the direct editor
 * palette sidebar so Format panels and detached windows retain core behavior. */
.geEditor > .geSidebarContainer:not(.geFormatContainer):not(:has(.geSidebarFooter)) > div:first-child {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  position: relative;
}

.phins-loading-shell {
  align-items: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(14, 165, 233, 0.15), transparent 35%),
    radial-gradient(circle at 85% 85%, rgba(3, 105, 161, 0.12), transparent 38%),
    var(--phins-surface);
  display: flex;
  inset: 0;
  justify-content: center;
  position: fixed;
}

.phins-loading-card {
  color: var(--phins-ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  width: min(360px, calc(100vw - 48px));
}

.phins-loading-logo {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.1);
  box-sizing: border-box;
  display: block;
  height: auto;
  margin: 0 auto 22px;
  max-width: 100%;
  padding: 10px 12px;
  width: 320px;
}

.phins-loading-card p {
  color: var(--phins-muted);
  margin: 0 0 18px;
}

.phins-loading-track {
  background: #dbeafe;
  border-radius: 99px;
  height: 4px;
  margin: 0 auto 14px;
  overflow: hidden;
  width: 180px;
}

.phins-loading-track span {
  animation: phins-loading 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, #0ea5e9, #0369a1);
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 45%;
}

.phins-loading-status {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.phins-studio-button {
  gap: 7px;
}

.phins-studio-button img {
  height: 18px;
  width: 18px;
}

.geMenubar > .phins-studio-button[data-phins-action="phins-studio"] {
  margin-left: auto;
  margin-right: 4px;
}

.geMenubar > .phins-studio-button[data-phins-action="phins-studio"] + .geButtonContainer {
  margin-left: 0;
}

.geCompactMode .geMenubar > .phins-studio-button[data-phins-action="phins-studio"] {
  margin-left: auto;
  margin-right: 16px;
}

/* Keep the PHINs account action in draw.io's former Share slot and on the same
 * menubar row/control height as adjacent PHINs actions. */
.geMenubar .geButtonContainer {
  margin-top: 0;
}

.geMenubar .geButtonContainer .gePrimaryBtn:not(.geEmbedBtn) {
  height: 30px;
}

.phins-account-button {
  gap: 7px;
  margin-right: 16px;
  max-width: 150px;
}

.phins-account-icon {
  box-sizing: border-box;
  flex: 0 0 18px;
  height: 18px;
  position: relative;
  width: 18px;
}

.phins-account-icon::before,
.phins-account-icon::after {
  border: 1.6px solid currentColor;
  box-sizing: border-box;
  content: "";
  position: absolute;
}

.phins-account-icon::before {
  border-radius: 50%;
  height: 6px;
  left: 6px;
  top: 1px;
  width: 6px;
}

.phins-account-icon::after {
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  height: 7px;
  left: 3px;
  top: 10px;
  width: 12px;
}

.phins-account-button .phins-account-button-label {
  align-items: center;
  background-image: none !important;
  display: inline-flex;
  max-width: 126px;
  overflow: hidden;
  padding-left: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.geTabContainer a[href="https://github.com/jgraph/drawio"] {
  display: none !important;
}

.phins-theme-toggle {
  flex: 0 0 auto;
  margin: 1px 0 1px auto;
  min-width: 30px;
  padding: 0;
  position: relative;
  width: 30px;
  z-index: 2;
}

.phins-theme-icon {
  font-size: 16px;
  line-height: 1;
}

.phins-about {
  color: var(--phins-dialog-ink);
  font: 13px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 4px 8px 12px;
  text-align: center;
}

.phins-about img {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.1);
  box-sizing: border-box;
  height: auto;
  margin-bottom: 10px;
  max-width: 100%;
  padding: 8px 10px;
  width: 280px;
}

.phins-about h2 {
  font-size: 20px;
  margin: 0 0 4px;
}

.phins-about p {
  color: var(--phins-dialog-muted);
  margin: 6px 0;
}

.phins-about .phins-about-description {
  margin: 6px auto 16px;
  max-width: 440px;
}

.phins-about .phins-about-core {
  color: var(--phins-dialog-ink);
  font-weight: 700;
}

.phins-about .phins-about-independence {
  margin-top: 14px;
}

.phins-about .geBtn {
  margin-top: 12px;
}

.phins-account-dialog {
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  display: flex;
  flex-direction: column;
  font: 13px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 4px 10px 10px;
}

.phins-account-header h2,
.phins-account-setup h3,
.phins-account-action-card h3,
.phins-account-save-section h3,
.phins-account-workspace h3,
.phins-account-list-heading h3 {
  margin: 0;
}

.phins-account-header {
  flex: 0 0 auto;
}

.phins-account-brand {
  align-items: center;
  color: var(--phins-dialog-accent);
  display: flex;
  font-size: 11px;
  font-weight: 750;
  gap: 8px;
  letter-spacing: 0.075em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.phins-account-brand img {
  background: #fff;
  border-radius: 7px;
  box-sizing: border-box;
  height: 28px;
  object-fit: contain;
  padding: 2px;
  width: 36px;
}

.phins-account-header h2 {
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.phins-account-header p {
  color: var(--phins-dialog-muted);
  font-size: 13px;
  margin: 7px 0 0;
  max-width: 410px;
}

.phins-account-status {
  border: 1px solid var(--phins-dialog-border);
  border-radius: 9px;
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 9px 11px;
}

.phins-account-status.is-busy { color: var(--phins-dialog-muted); }
.phins-account-status.is-error { color: var(--phins-dialog-error); }
.phins-account-status.is-success { color: var(--phins-dialog-success); }

.phins-account-onboarding {
  min-height: 0;
  overflow: auto;
  padding-top: 18px;
}

.phins-account-benefits {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 14px;
}

.phins-account-benefits li {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 24px minmax(0, 1fr);
}

.phins-account-benefit-marker,
.phins-account-workspace-marker {
  align-items: center;
  background: var(--phins-dialog-success-soft);
  border-radius: 50%;
  color: var(--phins-dialog-success);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.phins-account-primary-actions {
  margin-top: 18px;
}

.phins-google-button {
  align-items: center;
  background: #fff;
  border: 1px solid #747775;
  border-radius: 20px;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  display: grid;
  font: 500 14px/20px "Google Sans", Roboto, Arial, sans-serif;
  grid-template-columns: 20px minmax(0, 1fr) 20px;
  height: 40px;
  padding: 0 12px;
  text-align: center;
  width: 100%;
}

.phins-google-button:hover:not(:disabled) {
  background: #f8fafd;
  border-color: #5f6368;
}

.phins-google-button:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

.phins-google-button:disabled {
  cursor: default;
  opacity: 0.62;
}

.phins-google-mark {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABF1JREFUeAHtmX9sU1UUx7/3vf5km6vLNsYG22Rkwx8hNcMIrKsozBjBhf0BwRAjxh//ilGT+afKHxMRExWNJAYNwWiiBlimSIyZZGqMnVaJIq4DWhgbjLHSdrSlffd67tsqIYPwXsvSkuybnPdeXs5tP+/ce885fWUgdXZ21qeFtpsu3WQu5FkMbJ/KlBe6urpOsim439tWt7m8nlY4HA7kU4lEAr/2+3Cg+0DYwtR71eUty3e3r213P7TyQVgsFuRbkqGutlZeOgLHA25FAOuWLm1GoanV45EntyKPTocThaYpJpeCAtcsYK6aBcxVuSW+iRjEoW+BP/8ABgPA2REqAwyonAssagJWeMBWr0IuyhpQ9PYAH74PEY4DHDoYk3BSo2NgF/yA7xjweTewcR2waiWyUVaA4ss3gP1fAEkbLRIrmLh6pTBmpYOdHKkMnAkC27fRQ1wG2h6GWZkH/P5VsP69EMWUSDUC01QITpEjFiYkHd0TGgFNkKXpmqzhDpruFchG5gCDe4HQe0CFQ19qQqNptd1GkdkEdj+VpoZFk36Dg8C+r4BDB+leA7BtB1BUjGxkDnD4NdoAtObsHEIV4GV1UDfsBBY0Xu0noV58map8B1BVlTWcOcCxPeQd1LtFYRdIWB2wPfAORbPx+mMyEc1BxgGjtGsttL6o/+F01qofh1pxJ2ZaxgETf+s7VgJqzAZ7zfprunXsTOu7l0mT65QOGm0cIftkuqcIjme8KtYsMVYjjAOmTiFTeBh9oWqvuaZbMHLlI2VWFNM8VBw9B6yBMRkHlDkNk6awTE65wRDkLuO12FpN+S4FTqbxBHjyBExr6hmL7caHGI4gt9+FVHwASYpkjEyc/xg1Jd5pfr+9Mn3ss58K9Icmr2U5XDwXhmU4gqmiVoxzDSOc4yTV3p/PfYLTkcM3HHc6oqFveAJpNQmuaBRAgcaZALSWP4kRxYUTNEUBAhzgFnzw7/M4mxi67phQLIH2ngHEnKO4ZIsgaYnDXZ9GdSkMyzCgorpQVrsDIaq7QaHiFHfir/hFPPbLerx09F0ciQb/9w3GL2DrsZ9w33c9+Cc9hJh9HBO2i5TcI3jOw2BGpkpdbflmLIgdgX9oF86LYoyLUkRFCfYM/4iPzvTrXRfVQHBtDrRUOTRRBWGTyVDR98fTS0qxbL656mq6o36k/i0sm7cFYV6CKC/GJUEw9Jw840DphykpinicLEZpL4q0NYYNi4uwtaUSZpVVy//EwtexpfFN3O5YiMvCBk5RY8hMnawg1G4pSQKNk08a25ubsKulCdko64760aq1un02fBjdo35agyGEEmP6Lq1zluHuogZ4Su/BpvnNcFlNJL6bBZjRxnle3WZKsz87c9UsYK66JQDD8UQchaYMkwT09/X1odDk8/nkab/qbfX+MHA8sHmOw+moqKyA1WJFPiUj19vbi68PfiNfonfo9Um+6deE9rZ8X438K0xV02+B+pT8G+I/GQh/7Ve+elUAAAAASUVORK5CYII=");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 40px 40px;
  height: 20px;
  overflow: hidden;
  width: 20px;
}

.phins-google-balance {
  height: 20px;
  width: 20px;
}

.phins-account-consent-note {
  color: var(--phins-dialog-muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 10px 8px 0;
  text-align: center;
}

.phins-account-unavailable {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 12px;
  color: var(--phins-dialog-muted);
  padding: 14px;
}

.phins-account-unavailable p {
  margin: 0;
}

.phins-account-identity {
  align-items: center;
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 10px;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 10px;
}

.phins-account-avatar {
  align-items: center;
  background: var(--phins-primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  flex: 0 0 34px;
  font-size: 15px;
  font-weight: 700;
  height: 34px;
  justify-content: center;
}

.phins-account-identity-copy,
.phins-account-file-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.phins-account-identity-copy span,
.phins-account-file-copy span,
.phins-account-empty {
  color: var(--phins-dialog-muted);
  font-size: 12px;
}

.phins-account-identity-copy strong,
.phins-account-file-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-account-setup {
  flex: 0 0 auto;
  margin-top: 14px;
}

.phins-account-setup > h3 {
  font-size: 12px;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.phins-account-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.phins-account-steps li {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  text-align: center;
}

.phins-account-steps li::after {
  border-top: 1px solid var(--phins-dialog-border);
  content: "";
  left: calc(50% + 17px);
  position: absolute;
  top: 12px;
  width: calc(100% - 34px);
}

.phins-account-steps li:last-child::after {
  display: none;
}

.phins-account-step-marker {
  align-items: center;
  background: var(--phins-dialog-canvas);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 50%;
  box-sizing: border-box;
  display: flex;
  font-size: 11px;
  font-weight: 750;
  height: 25px;
  justify-content: center;
  position: relative;
  width: 25px;
  z-index: 1;
}

.phins-account-steps .is-complete .phins-account-step-marker {
  background: var(--phins-dialog-success-soft);
  border-color: var(--phins-dialog-success);
  color: var(--phins-dialog-success);
}

.phins-account-steps .is-current .phins-account-step-marker {
  background: var(--phins-dialog-primary-soft);
  border-color: var(--phins-dialog-accent);
  color: var(--phins-dialog-accent);
}

.phins-account-step-copy {
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  min-width: 0;
}

.phins-account-step-copy strong {
  font-size: 11px;
}

.phins-account-step-copy span {
  color: var(--phins-dialog-muted);
  font-size: 10px;
}

.phins-account-workspace {
  flex: 1;
  margin-top: 14px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.phins-account-action-card {
  background: var(--phins-dialog-canvas);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 12px;
  padding: 14px;
}

.phins-account-action-card h3,
.phins-account-save-section h3,
.phins-account-list-heading h3,
.phins-account-workspace-summary h3 {
  font-size: 13px;
}

.phins-account-action-card p {
  color: var(--phins-dialog-muted);
  margin: 5px 0 12px;
}

.phins-account-block-action {
  box-sizing: border-box;
  min-height: 34px;
  width: 100%;
}

.phins-account-workspace-summary {
  align-items: center;
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 10px;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.phins-account-workspace-summary > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.phins-account-workspace-summary span:not(.phins-account-workspace-marker) {
  color: var(--phins-dialog-muted);
  font-size: 11px;
}

.phins-account-save-section {
  margin-top: 14px;
}

.phins-account-save-section > label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  margin-top: 7px;
}

.phins-account-save-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) max-content;
  margin: 5px 0 16px;
}

.phins-account-save-row input {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  font: inherit;
  min-width: 0;
  padding: 7px 9px;
}

.phins-account-save-row input:focus {
  border-color: var(--phins-dialog-accent);
  outline: 2px solid var(--phins-dialog-primary-soft);
  outline-offset: 1px;
}

.phins-account-list-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.phins-account-file-list {
  display: grid;
  gap: 6px;
  list-style: none;
  margin: 8px 0 0;
  max-height: 150px;
  overflow: auto;
  padding: 0;
}

.phins-account-file-list li {
  align-items: center;
  border: 1px solid var(--phins-dialog-border);
  border-radius: 7px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) max-content;
  padding: 8px 9px;
}

.phins-account-footer {
  align-items: center;
  border-top: 1px solid var(--phins-dialog-border);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
}

.phins-account-footer-secondary {
  display: flex;
  gap: 6px;
}

.phins-account-danger {
  color: var(--phins-dialog-error);
}

@media (max-width: 560px) {
  .phins-account-dialog {
    padding-left: 6px;
    padding-right: 6px;
  }

  .phins-account-header h2 {
    font-size: 20px;
  }

  .phins-account-save-row {
    grid-template-columns: 1fr;
  }

  .phins-account-footer {
    align-items: stretch;
    gap: 8px;
  }

  .phins-account-footer > .geBtn {
    flex: 1 0 auto;
  }
}

.geSmallAppIcon.phins-app-icon {
  background: #fff;
  border-radius: 8px;
  box-sizing: border-box;
  height: 32px;
  margin: 4px 4px 4px 8px;
  object-fit: contain;
  padding: 2px;
  width: 42px;
}

/*
 * App.updateHeader creates this anchor after the plugin starts. Keeping the
 * visual override in the PHINs overlay makes the brand stable across that
 * lifecycle and prevents upstream hover handlers from restoring its logo.
 */
.geAppIcon {
  background-color: #fff;
  background-image: url("assets/brand-mark.png") !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain !important;
  border-radius: 8px;
  box-sizing: border-box;
  opacity: 1;
  width: 40px;
}

.geDarkMode {
  --phins-dialog-ink: #f8fafc;
  --phins-dialog-muted: #cbd5e1;
  --phins-dialog-border: #64748b;
  --phins-dialog-surface: #1e293b;
  --phins-dialog-canvas: #0f172a;
  --phins-dialog-surface-hover: #0c4a6e;
  --phins-dialog-accent: #7dd3fc;
  --phins-dialog-primary-soft: #0c4a6e;
  --phins-dialog-success-soft: #14532d;
  --phins-dialog-error: #fca5a5;
  --phins-dialog-warning: #fcd34d;
  --phins-dialog-success: #86efac;
}

.phins-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.phins-studio-dialog {
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  display: flex;
  flex-direction: column;
  font: 13px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100%;
  min-height: 0;
  padding: 4px 8px 10px;
}

.phins-dialog-heading h2 {
  font-size: 19px;
  margin: 0 0 3px;
}

.phins-dialog-heading p {
  color: var(--phins-dialog-muted);
  margin: 0 0 12px;
}

.phins-studio-dialog .phins-dialog-heading {
  margin-bottom: 7px;
}

.phins-studio-metadata {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(112px, 0.45fr) minmax(280px, 1.35fr) minmax(220px, 0.9fr);
  margin-bottom: 10px;
}

.phins-studio-dialog[data-authoring="story"] .phins-studio-metadata {
  grid-template-columns: minmax(130px, 0.55fr) minmax(260px, 1fr) minmax(280px, 1.2fr);
}

.phins-studio-field[hidden] {
  display: none;
}

.phins-studio-field {
  display: grid;
  gap: 4px;
  grid-template-rows: max-content 34px;
  min-width: 0;
}

.phins-studio-metadata label {
  color: var(--phins-dialog-muted);
  font-weight: 600;
  line-height: 1.25;
}

.phins-studio-metadata select {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  font: inherit;
  height: 34px;
  min-width: 0;
  padding: 6px 10px;
  width: 100%;
}

.phins-studio-model-picker {
  font-weight: 700 !important;
}

.phins-studio-blueprint-summary {
  color: var(--phins-dialog-muted);
  font-size: 12px;
  line-height: 1.4;
  margin: -4px 0 8px;
  overflow-wrap: anywhere;
}

.phins-studio-candidate-summary {
  align-items: center;
  align-self: flex-start;
  background: var(--phins-dialog-primary-soft);
  border: 1px solid var(--phins-dialog-accent);
  border-radius: 999px;
  color: var(--phins-dialog-ink);
  display: inline-flex;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  margin: -3px 0 8px;
  max-width: 100%;
  overflow: hidden;
  padding: 4px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-studio-candidate-summary[hidden] {
  display: none;
}

.phins-studio-candidate-summary::before {
  background: var(--phins-dialog-accent);
  border-radius: 50%;
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-right: 7px;
  width: 6px;
}

.phins-studio-blueprint-summary[hidden] {
  display: none;
}

.phins-studio-blueprint-summary[data-dynamic="true"]::before {
  background: var(--phins-dialog-success);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 6px;
  margin: 0 7px 1px 1px;
  width: 6px;
}

.phins-studio-metadata select:focus {
  border-color: #0284c7;
  outline: 2px solid rgba(2, 132, 199, 0.18);
}

.geDialog > .phins-studio-help-button,
.geDialog > .phins-studio-fullscreen-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--phins-dialog-muted);
  cursor: pointer;
  display: inline-flex;
  font: 700 13px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 20px;
  justify-content: center;
  opacity: 0.65;
  padding: 0;
  position: absolute;
  top: 8px;
  transition: opacity 100ms ease, background-color 100ms ease;
  width: 20px;
  z-index: 1;
}

.geDialog > .phins-studio-help-button {
  right: 36px;
}

.geDialog > .phins-studio-fullscreen-button {
  right: 64px;
}

.geDialog > .phins-studio-help-button:hover,
.geDialog > .phins-studio-fullscreen-button:hover {
  background: rgba(2, 132, 199, 0.12);
  color: var(--phins-primary);
  opacity: 1;
}

.geDialog > .phins-studio-help-button:focus-visible,
.geDialog > .phins-studio-fullscreen-button:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
  opacity: 1;
}

.phins-studio-fullscreen-glyph {
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
  display: block;
  height: 10px;
  position: relative;
  width: 10px;
}

.phins-studio-fullscreen-button[aria-pressed="true"] .phins-studio-fullscreen-glyph {
  transform: translate(-1px, 1px);
}

.phins-studio-fullscreen-button[aria-pressed="true"] .phins-studio-fullscreen-glyph::after {
  background: var(--phins-dialog-surface);
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
  content: "";
  height: 8px;
  left: 3px;
  position: absolute;
  top: -4px;
  width: 8px;
}

.geDialog.phins-studio-fullscreen {
  border: 0;
  border-radius: 0;
  height: 100vh !important;
  left: 0 !important;
  max-height: none !important;
  max-width: none !important;
  padding: 16px;
  top: 0 !important;
  transform: none !important;
  width: 100vw !important;
}

@supports (height: 100dvh) {
  .geDialog.phins-studio-fullscreen {
    height: 100dvh !important;
  }
}

.phins-formal-workspace {
  display: grid;
  flex: 1;
  gap: 12px;
  grid-template-columns: minmax(300px, 0.9fr) minmax(340px, 1.1fr);
  min-height: 0;
}

.phins-formal-workspace .phins-formal-panel {
  display: grid;
  grid-template-rows: calc(1.45em + 3px) minmax(0, 1fr);
  min-height: 0;
}

.phins-formal-workspace label,
.phins-panel-label {
  font-weight: 700;
  margin-bottom: 3px;
}

.phins-formal-workspace small {
  color: var(--phins-dialog-muted);
  margin-bottom: 6px;
}

#phins-studio-source,
.phins-preview-viewport {
  grid-row: 2;
}

#phins-studio-source {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  box-sizing: border-box;
  color: #e2e8f0;
  flex: 1;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 300px;
  padding: 12px;
  resize: none;
  tab-size: 2;
  width: 100%;
}

#phins-studio-source:focus {
  border-color: #0284c7;
  outline: 2px solid rgba(2, 132, 199, 0.18);
}

.phins-preview-viewport {
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  flex: 1;
  min-height: 300px;
  overflow: auto;
}

.phins-studio-dialog[data-authoring="story"] .phins-preview-viewport {
  background-color: var(--phins-dialog-canvas);
  background-image: none;
}

.phins-story-preview {
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 16px;
}

.phins-story-preview header,
.phins-story-preview-chapters > li,
.phins-story-event-reference {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 8px;
  box-sizing: border-box;
  padding: 12px;
}

.phins-story-preview h3,
.phins-story-preview h4,
.phins-story-preview p {
  margin: 0;
}

.phins-story-preview header p,
.phins-story-preview-range,
.phins-story-preview-omitted {
  color: var(--phins-dialog-muted);
}

.phins-story-preview-chapters {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.phins-story-preview-chapters > li {
  display: grid;
  gap: 5px;
}

.phins-story-preview-narrative {
  border-left: 3px solid var(--phins-primary);
  padding-left: 9px;
}

.phins-story-event-reference {
  min-width: 0;
}

.phins-story-event-reference > ol {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 28px;
}

.phins-story-event-reference li {
  display: grid;
  gap: 2px 8px;
  grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
  overflow-wrap: anywhere;
}

.phins-story-event-reference li span {
  color: var(--phins-dialog-muted);
  grid-column: 1 / -1;
}

.phins-story-event-reference code {
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

.phins-story-preview-omitted {
  margin-top: 10px !important;
}

.phins-flow-preview {
  display: block;
  max-width: none;
}

.phins-network-preview {
  display: block;
  max-width: none;
}

.phins-dataflow-preview {
  display: block;
  max-width: none;
}

.phins-playback-speed {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 6px;
  color: var(--phins-dialog-ink);
  font: inherit;
  min-height: 30px;
  padding: 4px 8px;
}

.phins-dynamic-overlay {
  pointer-events: none;
}

.phins-dynamic-route {
  --phins-dynamic-role: #0e7490;
  fill: none;
  stroke: var(--phins-dynamic-role);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
  transition: opacity 90ms linear;
  vector-effect: non-scaling-stroke;
}

.phins-dynamic-route[data-visual-role="neutral"] { --phins-dynamic-role: #64748b; }
.phins-dynamic-route[data-visual-role="active"] { --phins-dynamic-role: #2563eb; }
.phins-dynamic-route[data-visual-role="transit"] { --phins-dynamic-role: #0e7490; }
.phins-dynamic-route[data-visual-role="danger"] { --phins-dynamic-role: #dc2626; }
.phins-dynamic-route[data-visual-role="success"] { --phins-dynamic-role: #16a34a; }
.phins-dynamic-route[data-visual-role="warning"] { --phins-dynamic-role: #d97706; }
.phins-dynamic-route[data-visual-role="changed"] { --phins-dynamic-role: #7c3aed; }
.phins-dynamic-route[data-visual-role="muted"] { --phins-dynamic-role: #94a3b8; }

.phins-dynamic-token-marker {
  --phins-dynamic-role: #2563eb;
}

.phins-dynamic-token-marker[data-visual-role="neutral"] { --phins-dynamic-role: #64748b; }
.phins-dynamic-token-marker[data-visual-role="active"] { --phins-dynamic-role: #2563eb; }
.phins-dynamic-token-marker[data-visual-role="transit"] { --phins-dynamic-role: #0e7490; }
.phins-dynamic-token-marker[data-visual-role="danger"] { --phins-dynamic-role: #dc2626; }
.phins-dynamic-token-marker[data-visual-role="success"] { --phins-dynamic-role: #16a34a; }
.phins-dynamic-token-marker[data-visual-role="warning"] { --phins-dynamic-role: #d97706; }
.phins-dynamic-token-marker[data-visual-role="changed"] { --phins-dynamic-role: #7c3aed; }
.phins-dynamic-token-marker[data-visual-role="muted"] { --phins-dynamic-role: #94a3b8; opacity: 0.62; }

.phins-dynamic-token-halo {
  fill: var(--phins-dynamic-role);
  stroke: none;
}

.phins-dynamic-token {
  fill: var(--phins-dynamic-role);
  stroke: #ffffff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.phins-dynamic-token-label-group {
  pointer-events: none;
}

.phins-dynamic-token-label-pill {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(148, 163, 184, 0.72);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.phins-dynamic-token-label {
  fill: #0f172a;
  font: 650 9.5px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}

.phins-dynamic-entity-node,
.phins-dynamic-entity-link {
  --phins-dynamic-role: #2563eb;
  fill: none;
  opacity: 0.22;
  pointer-events: none;
  stroke: var(--phins-dynamic-role);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  transition: opacity 180ms ease, stroke-width 180ms ease;
  vector-effect: non-scaling-stroke;
}

.phins-dynamic-entity-node[data-active="true"],
.phins-dynamic-entity-link[data-active="true"] {
  opacity: 0.88;
  stroke-width: 2.75;
}

.phins-dynamic-entity-node[data-visual-role="neutral"],
.phins-dynamic-entity-link[data-visual-role="neutral"] { --phins-dynamic-role: #64748b; }
.phins-dynamic-entity-node[data-visual-role="active"],
.phins-dynamic-entity-link[data-visual-role="active"] { --phins-dynamic-role: #2563eb; }
.phins-dynamic-entity-node[data-visual-role="transit"],
.phins-dynamic-entity-link[data-visual-role="transit"] { --phins-dynamic-role: #0e7490; }
.phins-dynamic-entity-node[data-visual-role="success"],
.phins-dynamic-entity-link[data-visual-role="success"] { --phins-dynamic-role: #16a34a; }
.phins-dynamic-entity-node[data-visual-role="warning"],
.phins-dynamic-entity-link[data-visual-role="warning"] { --phins-dynamic-role: #d97706; }
.phins-dynamic-entity-node[data-visual-role="danger"],
.phins-dynamic-entity-link[data-visual-role="danger"] { --phins-dynamic-role: #dc2626; }
.phins-dynamic-entity-node[data-visual-role="changed"],
.phins-dynamic-entity-link[data-visual-role="changed"] { --phins-dynamic-role: #7c3aed; }
.phins-dynamic-entity-node[data-visual-role="muted"],
.phins-dynamic-entity-link[data-visual-role="muted"] {
  --phins-dynamic-role: #94a3b8;
  opacity: 0.14;
}

.geFormatContainer.phins-dynamic-format-active > .geFormatContent:not(.phins-dynamic-format-panel) {
  display: none !important;
}

/* Native Format tabs use equal zero-basis flex widths. Content-aware bases keep
   the complete Dynamic Flow and short native labels readable at 240px. The
   four-tab selected-cell state uses two bounded rows instead of stealing canvas
   width or relying on ellipsis. */
.geFormatTitleContainer.phins-dynamic-format-tabs {
  justify-content: stretch;
}

.geFormatTitleContainer.phins-dynamic-format-tabs > .geFormatTitle {
  flex: 1 1 auto;
  min-width: 0;
}

.geFormatTitleContainer.phins-dynamic-format-tabs > .geFormatTitle > div {
  width: auto;
}

.geFormatTitleContainer.phins-dynamic-format-tabs-stacked {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 68px;
}

.geFormatTitleContainer.phins-dynamic-format-tabs-stacked > .geFormatTitle {
  box-sizing: border-box;
  height: 34px;
  width: auto;
}

.geFormatTitleContainer.phins-dynamic-format-tabs-stacked > .geFormatTitle:nth-child(odd) {
  border-left-style: none;
}

.geFormatTitleContainer.phins-dynamic-format-tabs-stacked > .geFormatTitle:nth-child(-n + 2) {
  border-bottom-style: solid;
}

.phins-dynamic-format-tab > div {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-width: 0;
}

.phins-dynamic-format-tab[data-phins-dynamic-state="ready"] > div::after,
.phins-dynamic-format-tab[data-phins-dynamic-state="warning"] > div::after,
.phins-dynamic-format-tab[data-phins-dynamic-state="invalid"] > div::after {
  background: #16a34a;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.phins-dynamic-format-tab[data-phins-dynamic-state="warning"] > div::after {
  background: #d97706;
}

.phins-dynamic-format-tab[data-phins-dynamic-state="invalid"] > div::after {
  background: #dc2626;
}

.phins-dynamic-format-body {
  box-sizing: border-box;
  color: #0f172a;
  padding: 0 10px 16px 0;
  white-space: normal;
  width: 100%;
}

.phins-dynamic-format-empty {
  align-items: center;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 30px 10px;
  text-align: center;
}

.phins-dynamic-format-empty[hidden] {
  display: none;
}

.phins-dynamic-format-empty img {
  height: 34px;
  margin-bottom: 2px;
  width: 34px;
}

.phins-dynamic-format-empty strong {
  color: #0f172a;
  font-size: 13px;
}

.phins-dynamic-format-empty p {
  line-height: 1.45;
  margin: 0 0 6px;
  white-space: normal;
}

.phins-dynamic-format-open {
  margin: 0;
  width: 100%;
}

.phins-dynamic-library {
  color: #475569;
  display: grid;
  font: 12px/1.45 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 10px;
  padding: 18px 8px 8px;
  white-space: normal;
}

.phins-dynamic-library[hidden] {
  display: none;
}

.phins-dynamic-library > img {
  height: 32px;
  justify-self: center;
  width: 32px;
}

.phins-dynamic-library > strong,
.phins-dynamic-library-heading strong,
.phins-dynamic-library-warning strong {
  color: #0f172a;
  font-size: 13px;
}

.phins-dynamic-library > p {
  margin: 0;
}

.phins-dynamic-library[data-phins-dynamic-state="empty"] {
  text-align: center;
}

.phins-dynamic-library-heading {
  align-items: center;
  display: flex;
  gap: 7px;
}

.phins-dynamic-library-status {
  background: #16a34a;
  border-radius: 50%;
  height: 8px;
  width: 8px;
}

.phins-dynamic-library-story-count {
  color: var(--phins-dialog-muted);
  font-size: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.phins-dynamic-library-select,
.phins-adoption-field input,
.phins-adoption-field select,
.phins-adoption-endpoints select,
.phins-adoption-table select {
  background: var(--phins-dialog-surface);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 6px;
  box-sizing: border-box;
  color: var(--phins-dialog-ink);
  font: inherit;
  min-height: 30px;
  min-width: 0;
  padding: 4px 8px;
  width: 100%;
}

.phins-dynamic-library-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
}

.phins-dynamic-library-actions .geBtn {
  margin: 0;
  min-height: 30px;
  width: 100%;
}

.phins-dynamic-library-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 7px;
  color: #9a3412;
  padding: 8px;
}

.phins-dynamic-library-warning ul {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  padding-left: 18px;
}

.phins-dynamic-adoption-dialog {
  gap: 0;
}

.phins-adoption-heading p {
  margin-bottom: 4px;
  max-width: 760px;
}

.phins-adoption-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 0.7fr) minmax(190px, 1fr) minmax(190px, 1fr);
  margin-bottom: 10px;
}

.phins-directed-profile-dialog {
  gap: 0;
}

.phins-directed-profile-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 4px 0 12px;
}

.phins-directed-profile-form .phins-adoption-field:first-child {
  grid-column: 1 / -1;
}

.phins-directed-profile-route {
  background: var(--phins-dialog-canvas);
  border: 1px solid var(--phins-dialog-border);
  border-radius: 7px;
  color: var(--phins-dialog-muted);
  margin: 0 0 10px;
  padding: 9px 10px;
}

.phins-directed-profile-diagnostics {
  min-height: 28px;
}

.phins-adoption-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.phins-adoption-field > span {
  color: var(--phins-dialog-muted);
  font-size: 11px;
  font-weight: 700;
}

.phins-adoption-mapping {
  border: 1px solid var(--phins-dialog-border);
  border-radius: 8px;
  flex: 1;
  min-height: 220px;
  overflow: auto;
  padding: 10px;
}

.phins-adoption-summary {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.phins-adoption-summary span {
  color: var(--phins-dialog-success);
  font-size: 11px;
  font-weight: 700;
}

.phins-adoption-endpoints {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.phins-adoption-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.phins-adoption-table th,
.phins-adoption-table td {
  border-bottom: 1px solid var(--phins-dialog-border);
  overflow-wrap: anywhere;
  padding: 7px 6px;
  text-align: left;
  vertical-align: middle;
}

.phins-adoption-table th {
  color: var(--phins-dialog-muted);
  font-size: 11px;
}

.phins-adoption-table th:nth-child(1) { width: 38%; }
.phins-adoption-table th:nth-child(2) { width: 28%; }
.phins-adoption-table th:nth-child(3) { width: 34%; }

.phins-adoption-table code {
  font-size: 11px;
}

.phins-adoption-connectors {
  color: var(--phins-dialog-muted);
  margin-top: 10px;
}

.phins-adoption-connectors summary {
  cursor: pointer;
  font-weight: 700;
}

.phins-adoption-connectors ul {
  margin: 7px 0 0;
  padding-left: 20px;
}

.phins-adoption-connectors li[data-phins-scenario-path="true"] {
  color: var(--phins-dialog-success);
}

.phins-adoption-diagnostics {
  flex: 0 0 auto;
}

.phins-playback-dock {
  box-sizing: border-box;
  color: #0f172a;
  display: grid;
  font: 12px/1.4 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 12px;
  min-width: 0;
  position: static;
  width: 100%;
}

.phins-playback-dock.phins-playback-presenter {
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.62);
  border-radius: 16px;
  bottom: max(18px, env(safe-area-inset-bottom));
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.24);
  box-sizing: border-box;
  gap: 10px 12px;
  grid-template-areas:
    "summary summary"
    "chapter chapter"
    "inspector inspector"
    "controls meta"
    "timeline timeline";
  grid-template-columns: minmax(240px, 1fr) auto;
  left: 50%;
  max-height: min(42vh, 310px);
  max-width: calc(100vw - 32px);
  overflow: auto;
  padding: 14px;
  position: fixed;
  transform: translateX(-50%);
  width: min(840px, calc(100vw - 32px));
  z-index: 10020;
}

.phins-playback-summary {
  align-items: center;
  display: grid;
  gap: 5px 8px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  min-width: 0;
}

.phins-playback-summary strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-playback-legend {
  display: grid;
  gap: 5px 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.phins-playback-legend span {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.phins-playback-badge {
  background: #e0f2fe;
  border-radius: 99px;
  color: #075985;
  font-size: 10px;
  font-weight: 700;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  padding: 2px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-playback-metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  max-height: 132px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.phins-playback-metrics[hidden] { display: none; }

.phins-playback-metric {
  align-items: baseline;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 5px;
  min-width: 0;
  padding: 6px 7px;
}

.phins-playback-metric strong {
  color: #0369a1;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  max-width: 52%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phins-playback-metric span {
  color: #64748b;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.phins-playback-metric[data-visual-role="success"] strong { color: #15803d; }
.phins-playback-metric[data-visual-role="danger"] strong { color: #b91c1c; }
.phins-playback-metric[data-visual-role="changed"] strong { color: #6d28d9; }

.phins-playback-controls {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.phins-playback-chapter {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  display: grid;
  gap: 7px;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  min-width: 0;
  padding: 6px;
}

.phins-playback-chapter[hidden] { display: none; }

.phins-playback-chapter-copy {
  align-items: baseline;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.phins-playback-chapter-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-playback-chapter-copy > span:not(.phins-playback-chapter-narrative) {
  color: #64748b;
  font-size: 10px;
  white-space: nowrap;
}

.phins-playback-chapter-narrative {
  color: #475569;
  font-size: 11px;
  grid-column: 1 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phins-playback-chapter-narrative[hidden] { display: none; }

.phins-playback-chapter-control {
  height: auto;
  min-height: 30px;
  min-width: 30px;
  padding: 0;
}

.phins-playback-control {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: 700 13px/1 ui-sans-serif, sans-serif;
  height: 34px;
  justify-content: center;
  min-width: 28px;
  padding: 0 7px;
}

.phins-playback-control:hover {
  background: #e0f2fe;
  border-color: #bae6fd;
}

.phins-playback-control:focus-visible,
.phins-playback-speed:focus-visible,
.phins-playback-timeline:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
}

.phins-playback-control:disabled,
.phins-playback-speed:disabled,
.phins-playback-timeline:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.phins-playback-primary {
  background: #0369a1;
  color: #ffffff;
}

.phins-playback-primary:hover {
  background: #075985;
  border-color: #075985;
}

.phins-playback-close {
  font-size: 18px;
  grid-column: 4;
  grid-row: 1 / span 2;
  height: 30px;
  min-width: 30px;
  padding: 0;
}

.phins-playback-present {
  font-size: 15px;
  grid-column: 3;
  grid-row: 1 / span 2;
  height: 30px;
  min-width: 30px;
  padding: 0;
}

.phins-playback-export {
  font-size: 15px;
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 30px;
  min-width: 30px;
  padding: 0;
}

.phins-playback-timeline-row {
  display: flex;
  min-width: 0;
}

.phins-playback-timeline {
  accent-color: #0369a1;
  flex: 1;
  margin: 0;
  min-width: 0;
  width: 100%;
}

.phins-playback-meta-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.phins-playback-time {
  color: #475569;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.phins-playback-inspector {
  align-items: stretch;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  padding: 9px 10px;
}

.phins-playback-event-row {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.phins-playback-event-row strong {
  overflow-wrap: anywhere;
}

.phins-playback-event-meta,
.phins-playback-explanation {
  color: #475569;
  overflow-wrap: anywhere;
  white-space: normal;
}

.phins-playback-event-meta {
  font-size: 10px;
}

.phins-playback-explanation {
  display: block;
  max-height: 9.8em;
  overflow: auto;
}

.phins-playback-dock.phins-playback-presenter .phins-playback-summary { grid-area: summary; }
.phins-playback-dock.phins-playback-presenter .phins-playback-chapter { grid-area: chapter; }
.phins-playback-dock.phins-playback-presenter .phins-playback-controls { grid-area: controls; }
.phins-playback-dock.phins-playback-presenter .phins-playback-timeline-row { grid-area: timeline; }
.phins-playback-dock.phins-playback-presenter .phins-playback-meta-row { grid-area: meta; }
.phins-playback-dock.phins-playback-presenter .phins-playback-metrics { grid-area: metrics; }
.phins-playback-dock.phins-playback-presenter .phins-playback-inspector { grid-area: inspector; }
.phins-playback-dock.phins-playback-presenter .phins-playback-details { grid-area: details; }

.phins-playback-dock.phins-playback-presenter .phins-playback-explanation {
  max-height: 5.6em;
}

.phins-playback-details {
  border-top: 1px solid #e2e8f0;
  color: #475569;
  padding-top: 8px;
}

.phins-playback-details summary {
  color: #334155;
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
  padding: 2px 0;
}

.phins-playback-details summary:focus-visible {
  border-radius: 4px;
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

.phins-playback-details-body {
  display: grid;
  gap: 9px;
  padding: 8px 0 2px;
}

body.phins-presenter-stage {
  overflow: hidden;
}

body.geEditor.phins-presenter-stage {
  grid-template-columns: 0 0 1fr 0;
  grid-template-rows: 0 0 1fr 0;
}

body.geEditor.phins-presenter-stage > .geMenubarContainer,
body.geEditor.phins-presenter-stage > .geToolbarContainer,
body.geEditor.phins-presenter-stage > .geSidebarContainer,
body.geEditor.phins-presenter-stage > .geHsplit,
body.geEditor.phins-presenter-stage > .geTabContainer,
body.geEditor.phins-presenter-stage > .geFooterContainer,
body.geEditor.phins-presenter-stage > .mxWindow,
body.geEditor.phins-presenter-stage > .mxPopupMenu {
  display: none !important;
}

body.geEditor.phins-presenter-stage > .geDiagramContainer {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  margin: 0 !important;
  z-index: 1;
}

body.phins-presenter-stage .phins-playback-dock.phins-playback-presenter .phins-playback-details {
  display: none;
}

.phins-playback-dock[data-event-state="danger"] .phins-playback-badge,
.phins-playback-dock[data-event-state="stale"] .phins-playback-badge {
  background: #fee2e2;
  color: #991b1b;
}

.phins-playback-dock[data-event-state="success"] .phins-playback-badge {
  background: #dcfce7;
  color: #166534;
}

.phins-playback-dock[data-event-state="warning"] .phins-playback-badge {
  background: #fef3c7;
  color: #92400e;
}

.geDarkMode .phins-playback-dock {
  color: #f8fafc;
}

.geDarkMode .phins-playback-dock.phins-playback-presenter {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(71, 85, 105, 0.9);
}

.geDarkMode .phins-dynamic-token-label {
  fill: #f8fafc;
}

.geDarkMode .phins-dynamic-token-label-pill {
  fill: rgba(15, 23, 42, 0.94);
  stroke: rgba(100, 116, 139, 0.82);
}

.geDarkMode .phins-dynamic-format-body,
.geDarkMode .phins-dynamic-format-empty,
.geDarkMode .phins-dynamic-library,
.geDarkMode .phins-playback-details,
.geDarkMode .phins-playback-details summary {
  color: #cbd5e1;
}

.geDarkMode .phins-dynamic-format-empty strong {
  color: #f8fafc;
}

.geDarkMode .phins-dynamic-library > strong,
.geDarkMode .phins-dynamic-library-heading strong,
.geDarkMode .phins-dynamic-library-warning strong {
  color: #f8fafc;
}

.geDarkMode .phins-dynamic-library-warning {
  background: #431407;
  border-color: #9a3412;
  color: #fed7aa;
}

.geDarkMode .phins-playback-badge {
  background: #0c4a6e;
  color: #bae6fd;
}

.geDarkMode .phins-playback-control:hover {
  background: #0c4a6e;
  border-color: #0369a1;
}

.geDarkMode .phins-playback-control {
  background: #1e293b;
  border-color: #475569;
}

.geDarkMode .phins-playback-primary {
  background: #0369a1;
  border-color: #0369a1;
}

.geDarkMode .phins-playback-time,
.geDarkMode .phins-playback-event-meta,
.geDarkMode .phins-playback-explanation,
.geDarkMode .phins-playback-legend span {
  color: #cbd5e1;
}

.geDarkMode .phins-playback-metric {
  background: #1e293b;
  border-color: #334155;
}

.geDarkMode .phins-playback-chapter {
  background: #1e293b;
  border-color: #334155;
}

.geDarkMode .phins-playback-chapter-copy > span:not(.phins-playback-chapter-narrative),
.geDarkMode .phins-playback-chapter-narrative {
  color: #cbd5e1;
}

.geDarkMode .phins-playback-metric span { color: #94a3b8; }

.geDarkMode .phins-playback-dock[data-event-state="danger"] .phins-playback-badge,
.geDarkMode .phins-playback-dock[data-event-state="stale"] .phins-playback-badge {
  background: #7f1d1d;
  color: #fecaca;
}

.geDarkMode .phins-playback-dock[data-event-state="success"] .phins-playback-badge {
  background: #14532d;
  color: #bbf7d0;
}

.geDarkMode .phins-playback-inspector {
  background: #1e293b;
  border-color: #334155;
}

.geDarkMode .phins-playback-details {
  border-color: #334155;
}

@media (prefers-reduced-motion: reduce) {
  .phins-dynamic-token-halo {
    display: none;
  }

  .phins-dynamic-route,
  .phins-dynamic-entity-node,
  .phins-dynamic-entity-link {
    transition: none;
  }

  .phins-playback-dock.phins-playback-presenter {
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  .phins-dynamic-route,
  .phins-dynamic-entity-node,
  .phins-dynamic-entity-link {
    opacity: 1;
    stroke: Highlight;
  }

  .phins-dynamic-token {
    fill: Highlight;
    stroke: Canvas;
  }

  .phins-dynamic-token-halo {
    display: none;
  }

  .phins-dynamic-token-label {
    fill: CanvasText;
  }

  .phins-dynamic-token-label-pill {
    fill: Canvas;
    stroke: CanvasText;
  }
}

@media (max-width: 760px) {
  .phins-playback-dock.phins-playback-presenter {
    bottom: max(8px, env(safe-area-inset-bottom));
    grid-template-areas:
      "summary"
      "chapter"
      "inspector"
      "controls"
      "timeline"
      "meta";
    grid-template-columns: minmax(0, 1fr);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    max-width: calc(100vw - 16px);
    padding: 12px;
    width: min(520px, calc(100vw - 16px));
  }

  .phins-studio-metadata {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
  }

  .phins-studio-dialog[data-authoring="story"] .phins-studio-metadata {
    grid-template-columns: minmax(0, 1fr);
  }

  .phins-adoption-form {
    grid-template-columns: 1fr;
  }

  .phins-adoption-endpoints {
    grid-template-columns: 1fr;
  }

}

.phins-diagnostics {
  max-height: 94px;
  min-height: 28px;
  overflow: auto;
  padding-top: 7px;
}

.phins-diagnostics ul {
  margin: 0;
  padding-left: 22px;
}

.phins-diagnostics p { margin: 2px 0; }
.phins-diagnostic-error { color: var(--phins-dialog-error); }
.phins-diagnostic-warning { color: var(--phins-dialog-warning); }
.phins-diagnostic-success { color: var(--phins-dialog-success); }

.phins-dialog-actions {
  align-items: center;
  border-top: 1px solid var(--phins-dialog-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 9px;
}

.phins-change-summary {
  color: var(--phins-dialog-muted);
  margin-right: auto;
}

.phins-change-summary[data-review="warning"] {
  color: var(--phins-dialog-warning);
  font-weight: 600;
}

@media (max-width: 800px) {
  .phins-formal-workspace { grid-template-columns: 1fr; }
  .phins-preview-viewport { min-height: 220px; }
  #phins-studio-source { min-height: 220px; }
}

@keyframes phins-loading {
  from { transform: translateX(-110%); }
  to { transform: translateX(330%); }
}

@media (prefers-reduced-motion: reduce) {
  .phins-loading-track span { animation: none; width: 100%; }
}
