.studio-help {
  position: relative;
  flex: none;
}
.studio-help > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  list-style: none;
  padding: 12px 18px;
  border-radius: 9px;
  background: var(--accent, #252525);
  color: var(--on, #fff);
  font-weight: 650;
}
.studio-help > summary::-webkit-details-marker {
  display: none;
}
/* Lifebuoy: help and support. */
.studio-help > summary::before {
  content: '';
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: -10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='m5.6 5.6 3.6 3.6M14.8 14.8l3.6 3.6M18.4 5.6l-3.6 3.6M9.2 14.8l-3.6 3.6'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='m5.6 5.6 3.6 3.6M14.8 14.8l3.6 3.6M18.4 5.6l-3.6 3.6M9.2 14.8l-3.6 3.6'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.studio-help-items {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 100;
  width: min(310px, calc(100vw - 32px));
  padding: 10px;
  background: var(--surface, #fff);
  color: var(--text, #252525);
  border: 1px solid var(--line, #ddd);
  border-radius: 12px;
  box-shadow: 0 12px 32px #0002;
}
.studio-help-items button,
.studio-help-items a {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  white-space: normal;
  line-height: 1.5;
}
.studio-help-items button:disabled {
  opacity: 0.5;
  cursor: default;
}
.studio-help-items a:hover,
.studio-help-items button:not(:disabled):hover {
  background: var(--soft, #eee);
}
/* The signed-in e-mail above „Wyloguj”, the last item (owner 10.11). */
.studio-help-email {
  display: block;
  padding: 4px 12px 0;
  color: var(--muted, #666);
  font-size: 12px;
  overflow-wrap: anywhere;
}
/* A finger-sized target also where the menu's rows are lower (the Makieta's own header on a phone). */
.studio-help-items .studio-help-signout {
  min-height: 44px;
}
.studio-help-items hr {
  border: 0;
  border-top: 1px solid var(--line, #ddd);
  margin: 6px;
}
.studio-help > summary:focus-visible {
  outline: 3px solid #8b9faf;
  outline-offset: 3px;
}

.studio-help > summary > span {
  font-size: 0;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16m-7-7 7 7 7-7' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}
.studio-help[open] > summary > span {
  transform: rotate(180deg);
}

.module-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}
.module-menu > summary::-webkit-details-marker {
  display: none;
}
/* Four squares: the module switcher (the original logo mark). */
.module-menu > summary::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E")
    center/contain no-repeat;
}

/* iPhone: steps to add the app to the home screen. */
.install-steps {
  max-width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line, #ddd);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text, #252525);
}
.install-steps h3 {
  margin: 0 0 10px;
}
.install-steps ol {
  margin: 0 0 16px;
  padding-left: 20px;
  line-height: 1.6;
}

/* Pomoc → "Kontakt i zgłoś problem" (owner 09.10): a cross in the corner, two choices, the form. */
.help-contact {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  padding: 26px;
}
.help-contact h3 {
  margin: 0 40px 12px 0;
}
.help-contact p {
  margin: 0 0 12px;
  line-height: 1.55;
}
.help-contact .help-contact-hint {
  color: var(--muted, #666);
  font-size: 14px;
}
.help-contact-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.help-contact-close:hover,
.help-contact-close:focus-visible {
  background: var(--soft, #f0f0f0);
}
.help-contact-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 6px 0 16px;
}
.help-contact-choice {
  display: grid;
  gap: 4px;
  padding: 16px;
  text-align: left;
  font: inherit;
  color: inherit;
  border: 1px solid #a9bdb2;
  border-radius: 12px;
  background: #e3ebe5;
  cursor: pointer;
}
.help-contact-choice:hover {
  background: #d2dfd6;
}
.help-contact-choice strong {
  color: #415c4f;
}
.help-contact-choice small {
  color: var(--muted, #666);
  line-height: 1.4;
}
.help-ticket {
  display: grid;
  gap: 14px;
}
.help-ticket-field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}
.help-ticket-field select,
.help-ticket-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line, #ccc);
  border-radius: 9px;
  font: inherit;
  font-weight: 400;
  background: var(--surface, #fff);
  color: inherit;
}
.help-pay-now {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line, #ccc);
  border-radius: 12px;
  background: var(--soft, #f4f4f4);
}
.help-pay-now h4,
.help-pay-now p {
  margin: 0;
}
.help-pay-now .btn {
  justify-self: start;
}
.help-ticket-tech summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted, #666);
}
.help-ticket-tech pre {
  margin: 8px 0 0;
  padding: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  border-radius: 8px;
  background: var(--soft, #f4f4f4);
}
.help-ticket-error {
  margin: 0 !important;
  color: #b42318;
  font-size: 14px;
}
.help-ticket-error:empty {
  display: none;
}
.help-ticket .btn {
  justify-self: start;
}
@media (max-width: 520px) {
  .help-contact-choices {
    grid-template-columns: 1fr;
  }
}

/* "New version" notice (StudioVersion in global-help.js). */
.update-notice {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px;
  border-radius: 12px;
  background: #252525;
  color: #fff;
  font: 14px/1.3 inherit;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.update-notice button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #fff;
  color: #252525;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
html[data-view-mode='simple'] .update-notice {
  bottom: calc(84px + env(safe-area-inset-bottom));
}

/* Knowledge base (Pomoc → Baza wiedzy). */
/* `dialog.help-base` outranks the Makieta's own dialog and input styles (style.css). */
.help-base,
.help-base * {
  box-sizing: border-box;
}
dialog.help-base {
  max-width: none;
  overflow: hidden;
  width: min(640px, calc(100vw - 32px));
  max-height: min(80vh, 760px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #252525;
  font-family: inherit;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.help-base[open] {
  display: flex;
  flex-direction: column;
}
.help-base::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
.help-base-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
}
.help-base .help-base-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
  font-weight: 600;
}
.help-base-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}
.help-base input[type='search'] {
  display: block;
  width: calc(100% - 40px);
  font-size: 15px;
  margin: 0 20px 8px;
  padding: 10px 12px;
  border: 1px solid #d6d6d6;
  border-radius: 10px;
  font: inherit;
}
.help-base-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 20px 20px;
  line-height: 1.5;
}
.help-base-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.help-base-list button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e3e3e3;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.help-base-list small {
  color: #6b6b6b;
  font-size: 13px;
  line-height: 1.4;
}
.help-base .help-base-body p,
.help-base .help-base-body li {
  font-size: 14px;
  line-height: 1.55;
  color: inherit;
}
.help-base-back {
  margin: 4px 0 8px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.help-base h3 {
  margin: 0 0 8px;
}
.help-base ol {
  padding-left: 22px;
}
.help-base ol li {
  margin-bottom: 6px;
}
.help-base-tip {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f4f4;
}
html[data-theme='dark'] .help-base {
  background: #292929;
  color: #f1f1f1;
}
html[data-theme='dark'] .help-base input[type='search'],
html[data-theme='dark'] .help-base-list button {
  border-color: #444;
  background: transparent;
  color: inherit;
}
html[data-theme='dark'] .help-base-list small {
  color: #b5b5b5;
}
html[data-theme='dark'] .help-base-tip {
  background: #333;
}

/* Header controls (Menu, Moduły, Tryb ciemny, Pomoc): one height and one font size on every page,
   also in the Makieta, which has its own header (owner, 02.10). */
.topbar #globalMenuToggle,
.topbar #panelTheme,
.topbar .module-menu > summary,
.shell-header .module-menu > summary,
.shell-header .theme {
  box-sizing: border-box;
  min-height: 46px;
  font-size: 14px;
}
/* The module list is wide enough for the longest name with a lock icon on one line. */
@media (min-width: 701px) {
  .module-menu-links,
  .module-menu .help-menu-items {
    min-width: 290px;
  }
  .module-menu-links a,
  .module-menu .help-menu-items a {
    white-space: nowrap;
  }
}
/* Tips „i” (modules/tips.js) */
.studio-tip {
  display: inline-grid;
  place-items: center;
  width: 1.25em;
  height: 1.25em;
  min-width: 18px;
  min-height: 18px;
  margin-left: 0.15em;
  border-radius: 50%;
  background: #e4ece6;
  color: #2f4a3e;
  font:
    italic 700 12px/1 Georgia,
    serif;
  /* next to a text: centred on the line (owner 10.10) */
  vertical-align: middle;
  position: relative;
  top: -0.12em;
  cursor: pointer;
  user-select: none;
  letter-spacing: 0;
  text-transform: none;
}
/* in a box: the top right corner of the box (owner 10.10) */
.studio-tip-box {
  position: relative;
}
/* span.… outweighs the box's own rules for its spans (e.g. the label of a figure tile) */
span.studio-tip.studio-tip-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-grid;
  width: 20px;
  height: 20px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  font-size: 12px;
  line-height: 1;
}
.studio-tip-near {
  padding-right: 22px;
}
.studio-tip:hover,
.studio-tip[aria-expanded='true'] {
  background: #415c4f;
  color: #fff;
}
.studio-tip:focus-visible {
  outline: 2px solid #415c4f;
  outline-offset: 2px;
}
.studio-tip-bubble {
  position: fixed;
  z-index: 2147483600;
  padding: 14px 16px 12px;
  border-radius: 12px;
  background: #1f2a24;
  color: #f2f5f3;
  box-shadow: 0 12px 32px -10px #0008;
  font:
    14px/1.55 Satoshi,
    system-ui,
    sans-serif;
}
.studio-tip-bubble b {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}
.studio-tip-bubble p {
  margin: 0;
  color: #d6dfda;
}
.studio-tip-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ffffff22;
}
.studio-tip-foot button {
  padding: 0;
  border: 0;
  background: none;
  color: #a9d3bc;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.studio-tip-foot .studio-tip-off {
  color: #9aa59e;
  font-weight: 400;
}
@media print {
  .studio-tip,
  .studio-tip-bubble {
    display: none !important;
  }
}
/* Inside a window (Rozmowy, owner 11.10) the window's own text colours must not reach the bubble. */
dialog .studio-tip-bubble,
dialog .studio-tip-bubble b {
  color: #f2f5f3 !important;
}
dialog .studio-tip-bubble p {
  margin: 0 !important;
  color: #d6dfda !important;
  font-size: 14px !important;
}

/* Saved on this device and acknowledged by the server are different states. */
.studio-save-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 6px 24px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted, #626b65);
  border-bottom: 1px solid var(--line, #ddd);
}
.studio-save-status .btn {
  min-height: 28px;
  padding: 3px 8px;
  font-size: inherit;
}
.studio-save-status [hidden] {
  display: none;
}
.studio-save-status[data-state='error'],
.studio-save-status[data-state='login'],
.studio-save-status[data-state='readonly'] {
  color: #a33632;
}
[data-theme='dark'] .studio-save-status {
  color: #c0c9c3;
}
[data-theme='dark'] .studio-save-status[data-state='error'],
[data-theme='dark'] .studio-save-status[data-state='login'],
[data-theme='dark'] .studio-save-status[data-state='readonly'] {
  color: #ffb5b0;
}
@media (max-width: 760px) {
  .studio-save-status {
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 6px 16px;
  }
}
