/* 2026 interface refresh: clearer hierarchy, resilient responsive layout and
   stronger keyboard feedback without changing the BPMN workspace itself. */
:root {
  --ink: #102a43;
  --muted: #60758a;
  --line: #d9e3ea;
  --bg: #f4f7f8;
  --accent: #ef6644;
  --accent-dark: #cf4f30;
  --teal: #16766f;
  --soft-teal: #e8f4f1;
  --soft-orange: #fff1eb;
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.05);
  --shadow-md: 0 12px 32px rgba(16, 42, 67, 0.09);
}

html {
  color-scheme: light;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 85% 20%, rgba(22, 118, 111, 0.035), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

button:hover:not(:disabled) {
  border-color: #aebfca;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid rgba(35, 133, 204, 0.28);
  outline-offset: 2px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #4b8ea9;
  box-shadow: 0 0 0 3px rgba(75, 142, 169, 0.12);
  outline: 0;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 1px 1px rgba(102, 42, 24, 0.12);
}

.primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

header {
  position: relative;
  z-index: 20;
  min-width: 0;
  gap: clamp(14px, 2vw, 32px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header .brand,
.project-title,
.header-actions {
  min-width: 0;
}

.project-title {
  overflow: hidden;
}

.project-title > span:first-child,
.project-title > b {
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.header-actions {
  flex: 0 1 auto;
}

.header-actions button {
  white-space: nowrap;
}

.workflow {
  position: relative;
  z-index: 15;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.03);
}

.workflow button {
  position: relative;
  min-width: 128px;
}

.workflow button::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--line);
}

.workflow button:last-child::after {
  display: none;
}

.workflow button.active span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.workflow button.active,
.workflow button.active:hover {
  border-bottom-color: var(--accent);
}

.left-panel,
.right-panel {
  position: relative;
  z-index: 3;
}

.left-panel {
  width: 248px;
  padding: 22px 18px 18px;
}

.right-panel {
  width: 300px;
}

.tabs {
  min-height: 51px;
  align-items: center;
  padding-inline: 18px;
}

.tabs > span {
  font-size: 12px;
  font-weight: 800;
}

.left-panel h3 {
  margin: 6px 0 2px;
}

.project-row {
  padding: 11px 12px;
  border-radius: 9px;
}

.project-row.active {
  background: var(--soft-orange);
  border-color: #f1b9a7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.add-process {
  padding: 10px;
  color: #395a73;
}

.canvas-toolbar {
  height: 50px;
  padding-inline: 14px;
}

.canvas-toolbar button {
  min-width: 38px;
  min-height: 36px;
}

#canvas {
  height: calc(100% - 50px);
  background-color: #fbfcfc;
  background-image: radial-gradient(#cad6dd 0.8px, transparent 0.8px);
  background-size: 18px 18px;
}

.simple-mode .djs-palette [data-action="create.intermediate-event"],
.simple-mode .djs-palette [data-action="create.subprocess-expanded"],
.simple-mode .djs-palette [data-action="create.data-object"],
.simple-mode .djs-palette [data-action="create.data-store"],
.simple-mode .djs-palette [data-action="create.participant-expanded"],
.simple-mode .djs-palette [data-action="create.group"] {
  display: none;
}

.bjs-powered-by {
  opacity: 0.35;
  filter: grayscale(1);
}

body:has(.welcome:not(.hidden)) .bjs-powered-by {
  display: none;
}

.empty-properties {
  margin-top: 80px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #f0f4f6;
  font-size: 31px;
}

.content-view.active {
  padding-top: 44px;
}

.section-head {
  align-items: center;
}

.section-head h2 {
  font-size: clamp(30px, 3vw, 38px);
  letter-spacing: -0.025em;
}

.section-head > div > p:last-child {
  max-width: 620px;
  font-size: 15px;
}

.completion {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--soft-teal);
  font-weight: 700;
}

.completion::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.form-grid,
.score-card,
.brand-settings {
  border-color: #d6e0e6;
  box-shadow: var(--shadow-md);
}

.form-grid {
  gap: 21px 18px;
  border-radius: 15px;
  padding: 30px;
}

.form-grid label,
.brand-settings label,
.property-form label {
  color: #526b80;
}

.form-grid input,
.form-grid textarea {
  margin-top: 2px;
  border-color: #cbd8e0;
  background: #fcfdfd;
}

.score-card {
  border-radius: 15px;
  padding: 26px;
}

.score-card h3 {
  margin: 0 0 4px;
  font-size: 19px;
}

.score-card p {
  margin: 0;
  color: var(--muted);
}

.score-ring {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border: 0;
  background:
    radial-gradient(circle at center, #fff 57%, transparent 59%),
    conic-gradient(var(--teal) calc(var(--score, 0) * 1%), #dce8e5 0);
}

.score-ring::after {
  content: "%";
  margin-left: 1px;
  font-size: 10px;
  font-weight: 700;
}

.issue {
  align-items: center;
  min-height: 80px;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.issue > span:first-child {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff5d9;
  color: #8d6200;
  font-weight: 900;
}

.issue.error > span:first-child {
  background: #fde9e6;
  color: #a83f31;
}

.issue.ok > span:first-child {
  background: #e7f4ee;
  color: #27745a;
}

.issue > div {
  min-width: 0;
  flex: 1;
}

.issue-action {
  flex: 0 0 auto;
  color: #315b75;
  background: #f8fbfc;
}

.export-grid {
  gap: 16px;
}

.export-grid button {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.export-grid button:hover {
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
}

.brand-settings {
  border-radius: 14px;
  padding: 22px;
}

.publish-upgrade {
  display: none;
}

/* First-run experience */
.welcome {
  overflow: auto;
  background:
    radial-gradient(circle at 16% 22%, rgba(41, 130, 121, 0.28), transparent 25rem),
    radial-gradient(circle at 88% 78%, rgba(239, 102, 68, 0.16), transparent 25rem),
    #102a43;
}

.welcome::before,
.welcome::after {
  content: "";
  position: fixed;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  pointer-events: none;
}

.welcome::before {
  width: 520px;
  height: 520px;
  top: -310px;
  right: -100px;
}

.welcome::after {
  width: 340px;
  height: 340px;
  bottom: -240px;
  left: 5%;
}

.welcome-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(380px, 0.96fr);
  width: min(1080px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  background: #fbfaf7;
  box-shadow: 0 32px 90px rgba(2, 18, 32, 0.42);
}

.welcome-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: auto;
  padding: clamp(42px, 6vw, 74px);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.welcome h1 {
  max-width: 560px;
  margin: 14px 0 18px;
  font-size: clamp(46px, 5.2vw, 66px);
  letter-spacing: -0.04em;
}

.welcome .welcome-lead {
  max-width: 540px;
  margin: 0;
  color: #52697d;
  font-size: 17px;
}

.welcome-actions {
  margin-top: 32px;
}

.welcome-actions button {
  min-height: 49px;
  padding-inline: 20px;
  border-radius: 9px;
}

.welcome-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.welcome-trust > span {
  display: grid;
  gap: 1px;
  padding-right: 12px;
}

.welcome-trust b {
  color: var(--ink);
  font-size: 12px;
}

.welcome-trust small {
  color: var(--muted);
  font-size: 10px;
}

.welcome .privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 19px 0 0;
  color: #6d7f8f;
  font-size: 11px;
}

.welcome .privacy > span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #e2f0ec;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
}

.welcome-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 46px;
  color: #dce8ee;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #183851;
  background-size: 24px 24px;
}

.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: #c9d8e2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-topline i {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(75, 181, 158, 0.16);
  color: #a8e2d5;
  font-style: normal;
  letter-spacing: 0;
  text-transform: none;
}

.preview-document {
  padding: 26px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 45px rgba(3, 20, 33, 0.25);
  transform: rotate(-1deg);
}

.preview-document-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--accent);
}

.preview-document-head > span:last-child {
  display: grid;
}

.preview-document-head small {
  color: var(--teal);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.preview-document-head b {
  font-family: Georgia, serif;
  font-size: 18px;
}

.preview-logo {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: 20px Georgia, serif;
}

.preview-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
}

.preview-flow > i {
  position: relative;
  flex: 1;
  height: 2px;
  background: #91a5b3;
}

.preview-flow > i::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -1px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #91a5b3;
}

.flow-event {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  border: 2px solid #3d586c;
  border-radius: 50%;
  background: #fff;
}

.flow-task {
  flex: 0 0 auto;
  padding: 10px 12px;
  border: 1.5px solid #78909f;
  border-radius: 7px;
  background: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 1.25;
  text-align: center;
}

.flow-task.accent {
  border-color: #e8896f;
  background: #fff7f3;
}

.flow-gateway {
  flex: 0 0 auto;
  width: 23px;
  height: 23px;
  border: 1.5px solid #78909f;
  background: #fff;
  transform: rotate(45deg);
}

.preview-fields {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #e1e8ec;
}

.preview-fields > span {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f5f8f9;
}

.preview-fields small {
  color: #718493;
  font-size: 8px;
}

.preview-fields b {
  font-size: 10px;
}

.preview-outputs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 19px;
}

.preview-outputs span {
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #d7e3e9;
  font-size: 9px;
}

#toast {
  max-width: min(440px, calc(100vw - 28px));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 12px 30px rgba(5, 21, 34, 0.25);
}

#toast.show {
  visibility: visible;
  opacity: 1;
}

@media (max-width: 1180px) {
  header {
    padding-inline: 16px;
  }

  .project-title > span:first-child,
  .project-title .status,
  #save-state {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .header-actions button {
    padding-inline: 9px;
  }
}

@media (max-width: 920px) {
  header .brand > span:last-child {
    display: none;
  }

  header .brand {
    margin-right: auto;
  }

  .project-title {
    display: none;
  }

  #ai-settings-btn,
  #open-btn {
    font-size: 0;
  }

  #ai-settings-btn::after {
    content: "AI";
    font-size: 12px;
  }

  #open-btn::after {
    content: "Open";
    font-size: 12px;
  }

  .workflow button {
    min-width: 110px;
  }
}

@media (max-width: 760px) {
  .welcome-shell {
    grid-template-columns: 1fr;
    min-height: 0;
    max-width: 540px;
  }

  .welcome-preview {
    display: none;
  }

  .publish-upgrade {
    display: inline-flex;
    margin-top: 18px;
  }

  #pricing-btn,
  #ai-settings-btn,
  #open-btn,
  .language-select {
    display: none;
  }

  header {
    height: 64px;
  }

  header .brand > span:last-child {
    display: inline;
  }

  #save-btn {
    min-width: 86px;
  }

  .workflow {
    height: 62px;
    gap: 0;
  }

  .workflow button {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 4px 2px;
    font-size: 10px;
    line-height: 1;
  }

  .workflow button span {
    margin: 0;
  }

  .workflow button::after {
    right: -8px;
    top: 22px;
  }

  .view.active {
    height: calc(100vh - 126px);
  }

  .content-view.active {
    height: auto;
  }

  .section-head {
    display: block;
  }

  .section-head .completion {
    margin-top: 14px;
  }

  .form-grid {
    padding: 20px 17px;
  }

  .issue {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .issue-action {
    width: 100%;
    margin-left: 40px;
  }
}

@media (max-width: 480px) {
  .welcome {
    padding: 14px;
  }

  .welcome-shell {
    border-radius: 18px;
  }

  .welcome-card {
    padding: 32px 28px;
  }

  .welcome h1 {
    font-size: 40px;
  }

  .welcome .welcome-lead {
    font-size: 15px;
  }

  .welcome-actions {
    display: grid;
  }

  .welcome-actions button {
    width: 100%;
  }

  .welcome-trust {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 28px;
  }

  .welcome-trust > span {
    grid-template-columns: 98px 1fr;
    align-items: baseline;
  }

  header {
    padding-inline: 12px;
  }

  header .brand > span:last-child {
    display: none;
  }

  #save-btn {
    font-size: 0;
  }

  #save-btn::after {
    content: "Bewaren";
    font-size: 12px;
  }

  .canvas-toolbar {
    padding-inline: 8px;
  }

  .canvas-toolbar label {
    max-width: 92px;
    font-size: 11px;
    line-height: 1.15;
  }

  .content-view.active {
    padding: 28px 14px 52px;
  }

  .section-head h2 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
