/* Shared desktop interaction rules for every module embedded in the creation workbench. */
.zmtw-shell {
  --zmtw-control-height: 42px;
  --zmtw-focus-ring: 0 0 0 3px rgba(212, 175, 55, .24);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.zmtw-shell :where(button, input, select, textarea) {
  font-family: inherit;
}

.zmtw-shell :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  font-size: max(14px, 1em);
}

.zmtw-shell :where(button, [role="button"], a.zmtw-button) {
  min-height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.zmtw-shell :where(button, [role="button"], a.zmtw-button):focus-visible,
.zmtw-shell :where(input, select, textarea, summary, a):focus-visible {
  outline: 2px solid #b58a21;
  outline-offset: 2px;
  box-shadow: var(--zmtw-focus-ring);
}

.zmtw-shell :where(button, [role="button"], a.zmtw-button):active:not(:disabled) {
  transform: scale(.96);
}

.zmtw-shell :where(button, input, select, textarea):disabled,
.zmtw-shell [aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .52;
}

.zmtw-shell :where([data-zmtw-compute-balance], [data-zmtw-account-count], [data-zmtw-content-count], time, .zmtw-save-state) {
  font-variant-numeric: tabular-nums;
}

.zmtw-shell :where(h1, h2, h3, h4) {
  text-wrap: balance;
}

.zmtw-shell :where(p, small, li) {
  text-wrap: pretty;
}

/* Native tabs and segmented choices keep their meaning visible across tools. */
.zmtw-shell [role="tablist"] {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 5px;
  background: #f4f1eb;
  border: 1px solid #e2dbcf;
  border-radius: 10px;
}

.zmtw-shell [role="tab"] {
  min-height: 44px;
  padding: 9px 14px;
  color: #6f6a62;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.zmtw-shell [role="tab"][aria-selected="true"] {
  color: #2b2519;
  font-weight: 700;
  background: #fff;
  border-color: #d9bd67;
  box-shadow: 0 2px 8px rgba(54, 45, 28, .08), inset 0 -2px 0 #d4af37;
}

.zmtw-shell details > summary {
  min-height: 44px;
  cursor: pointer;
  user-select: none;
}

/* One visual grammar for common loading, empty and recoverable error panels. */
.zmtw-shell :where(.zmtw-membership-loading, .zmtw-data-loading, .zmtw-diagnosis-empty, .zmtw-diagnosis-error) {
  min-height: 128px;
  color: #302d28;
  background: #fff;
  border: 1px solid #e3ddd2;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(42, 35, 24, .05);
}

.zmtw-shell :where(.zmtw-diagnosis-empty, .zmtw-diagnosis-error) p,
.zmtw-shell :where(.zmtw-membership-error, .zmtw-notification-empty) {
  font-size: 14px;
  line-height: 1.65;
}

.zmtw-shell :where(.zmtw-membership-error, .zmtw-diagnosis-error, .zmtw-notification-empty.is-error) {
  color: #8f3434;
  background: #fff7f6;
  border-color: #e8cbc7;
}

.zmtw-save-state {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 9px;
}

.zmtw-save-state.is-idle {
  color: #766f64;
  background: #f6f3ed;
  border-color: #e5ded1;
}

.zmtw-save-state.is-saving {
  color: #70540c;
  background: #fff7df;
  border-color: #ead28d;
}

.zmtw-save-state.is-error {
  color: #9d3030;
  background: #fff1f1;
  border-color: #e6bcbc;
}

@media (prefers-reduced-motion: reduce) {
  .zmtw-shell *,
  .zmtw-shell *::before,
  .zmtw-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
