.button {
  position: relative;
  display: inline-flex;
  min-height: 43px;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}

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

.button--primary {
  border-color: transparent;
  background:
    radial-gradient(circle at 18% 0%, rgba(243, 111, 224, 0.72), transparent 42%),
    radial-gradient(circle at 88% 100%, rgba(67, 176, 237, 0.82), transparent 48%),
    linear-gradient(120deg, #6640c8, #7b4ed2 48%, #347fdd);
  box-shadow:
    0 11px 26px rgba(96, 61, 184, 0.22),
    0 0 22px rgba(62, 148, 224, 0.12);
  color: #fffdfb;
}

.button--primary::after {
  content: none;
}

.button--primary:hover {
  box-shadow:
    0 14px 32px rgba(111, 79, 189, 0.28),
    0 0 18px rgba(67, 134, 210, 0.16);
  transform: translateY(-1px);
}

.button--soft {
  border-color: rgba(29, 29, 31, 0.12);
  background:
    linear-gradient(135deg, rgba(100, 181, 246, 0.07), rgba(128, 104, 216, 0.06)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    0 6px 18px rgba(78, 58, 102, 0.07);
  color: var(--text-soft);
}

.button--soft:hover,
.button--ghost:hover {
  border-color: rgba(141, 87, 197, 0.32);
  color: var(--text);
  transform: translateY(-1px);
}

.button--ghost {
  color: var(--text-soft);
}

.button--large {
  min-height: 52px;
  padding-inline: 24px;
  font-size: 0.8rem;
}

.button--wide {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-soft);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(141, 87, 197, 0.35);
  color: var(--amethyst);
}

.live-pill,
.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(29, 158, 152, 0.25);
  border-radius: 999px;
  background: rgba(29, 158, 152, 0.09);
  color: #0d7772;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-pill > span,
.status-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentcolor;
  box-shadow: 0 0 8px currentcolor;
}

.status-pill.is-invalid {
  border-color: rgba(188, 73, 96, 0.24);
  background: rgba(188, 73, 96, 0.08);
  color: var(--error);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-index {
  display: grid;
  width: 33px;
  height: 33px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(141, 87, 197, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 13px rgba(141, 87, 197, 0.1);
  color: var(--amethyst);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 750;
}

.panel-heading__title small {
  display: block;
  margin-bottom: 2px;
  color: var(--amethyst);
  font-size: 0.53rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-heading__title h2,
.panel-heading__title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.execution-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(77, 89, 117, 0.14);
  border-radius: 13px;
  background: rgba(233, 239, 247, 0.72);
}

.execution-choice button {
  min-height: 34px;
  padding-inline: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.execution-choice button.is-active {
  border-color: rgba(63, 145, 201, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(26, 58, 92, 0.09);
  color: var(--text);
}

/* Shared automatic-decision card. */
.automatic-choice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-block: 6px;
  padding: 15px 16px;
  border: 1px solid rgba(63, 145, 201, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(222, 243, 255, 0.92), rgba(236, 247, 255, 0.82)),
    var(--surface-blue);
  color: var(--text);
}

.automatic-choice > .material-symbols-outlined {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(75, 165, 218, 0.14);
  color: #247bab;
  font-size: 19px;
}

.automatic-choice > div {
  display: grid;
  gap: 5px;
}

.automatic-choice strong {
  font-size: 0.68rem;
}

.automatic-choice p,
.automatic-choice small,
.brick-picker__automatic {
  margin: 0;
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.5;
}

.automatic-choice small {
  color: #276f9a;
  font-weight: 750;
}

.brick-picker__automatic {
  padding: 4px 3px 0;
}

.workbench-output-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-blue);
}

.workbench-output-tabs > span,
.workbench-output-tabs > button,
.workbench-output-tabs > a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding-inline: 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.workbench-output-tabs > button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.workbench-output-tabs > .is-active {
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.workbench-output-tabs > a:not(.is-disabled):hover {
  color: var(--sapphire);
}

.workbench-output-tabs > a.is-disabled {
  pointer-events: none;
  opacity: 0.42;
}

.workbench-output-tabs .material-symbols-outlined {
  font-size: 16px;
}

.drawing-panel__heading .workbench-output-tabs--panel {
  min-height: 36px;
  margin-left: auto;
}

.drawing-panel__heading .workbench-output-tabs--panel > button,
.drawing-panel__heading .workbench-output-tabs--panel > a {
  min-height: 30px;
  padding-inline: 9px;
}

.cookie-backdrop {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 20px;
  background: transparent;
  pointer-events: none;
}

.cookie-notice {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  width: min(570px, calc(100vw - 40px));
  max-height: min(760px, calc(100vh - 40px));
  gap: 16px;
  overflow-y: auto;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 28px;
  background:
    radial-gradient(circle at 5% 0%, rgba(117, 212, 255, .28), transparent 18rem),
    radial-gradient(circle at 100% 100%, rgba(157, 122, 238, .2), transparent 20rem),
    rgba(238, 248, 255, .68);
  box-shadow: 0 32px 110px rgba(27, 50, 100, .24), inset 0 1px rgba(255,255,255,.8);
  backdrop-filter: blur(34px) saturate(165%);
  pointer-events: auto;
}

.cookie-notice__header { display: flex; align-items: center; gap: 14px; }
.cookie-notice__header small { color: #5869b8; font-size: .57rem; font-weight: 900; letter-spacing: .14em; }
.cookie-notice__mark { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 15px; background: linear-gradient(145deg, #54cae9, #6c78df 55%, #9b65d7); box-shadow: 0 12px 28px rgba(84,106,198,.26), inset 0 1px rgba(255,255,255,.42); color: #fff; font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
.cookie-notice h2 { margin: 2px 0 0; color: #17344d; font-size: 1.3rem; letter-spacing: -.025em; }
.cookie-notice > p { margin: 0; color: #526e82; font-size: .76rem; line-height: 1.65; }
.cookie-notice__settings { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 15px; border: 1px solid rgba(99, 139, 197, .2); border-radius: 15px; background: rgba(255,255,255,.32); color: #1d4661; font: inherit; font-size: .72rem; font-weight: 850; cursor: pointer; }
.cookie-notice__settings b { color: #665bd0; font-size: 1.25rem; }
.cookie-preferences { display: grid; overflow: hidden; border: 1px solid rgba(99, 139, 197, .18); border-radius: 18px; background: rgba(255,255,255,.25); }
.cookie-preference { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; }
.cookie-preference + .cookie-preference { border-top: 1px solid rgba(99,139,197,.14); }
.cookie-preference strong, .cookie-preference small { display: block; }
.cookie-preference strong { color: #203e57; font-size: .73rem; }
.cookie-preference small { margin-top: 4px; color: #708798; font-size: .63rem; }
.cookie-preference > span { position: relative; width: 42px; height: 24px; flex: 0 0 42px; border-radius: 999px; background: rgba(101,118,145,.25); box-shadow: inset 0 1px 3px rgba(26,44,80,.2); }
.cookie-preference > span i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(28,50,87,.22); }
.cookie-preference > span.always-active { background: linear-gradient(90deg, #4dbedf, #7468dc); }
.cookie-preference > span.always-active i { left: 21px; }
.cookie-notice__actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cookie-notice__actions a { color: #496a82; font-size: .66rem; font-weight: 800; }
.cookie-notice .button { justify-self: end; }
:root[data-theme="dark"] .cookie-backdrop { background: transparent; }
:root[data-theme="dark"] .cookie-notice { border-color: rgba(166, 215, 255, .25); background: radial-gradient(circle at 0 0, rgba(61,155,207,.23), transparent 18rem), radial-gradient(circle at 100% 100%, rgba(117,72,184,.22), transparent 20rem), rgba(12, 29, 52, .74); }
:root[data-theme="dark"] .cookie-notice h2 { color: #e8f8ff; }
:root[data-theme="dark"] .cookie-notice > p, :root[data-theme="dark"] .cookie-preference small { color: #a9c2d4; }
:root[data-theme="dark"] .cookie-notice__settings, :root[data-theme="dark"] .cookie-preferences { border-color: rgba(142,198,231,.18); background: rgba(7,20,41,.3); color: #dcf4ff; }
:root[data-theme="dark"] .cookie-preference strong { color: #e6f6ff; }
:root[data-theme="dark"] .cookie-notice__actions a { color: #9bcbe2; }

@media (max-width: 620px) {
  .cookie-notice { right: 14px; bottom: max(76px, env(safe-area-inset-bottom)); width: calc(100vw - 28px); padding: 18px; }
  .cookie-notice__actions { align-items: stretch; flex-direction: column-reverse; }
  .cookie-notice__actions .button { width: 100%; }
}

:root[data-theme="dark"] .automatic-choice {
  border-color: rgba(100, 190, 244, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(87, 146, 215, 0.18), transparent 14rem),
    linear-gradient(145deg, rgba(20, 39, 55, 0.96), rgba(24, 31, 48, 0.92));
}

:root[data-theme="dark"] .execution-choice {
  border-color: rgba(126, 163, 198, 0.2);
  background: rgba(12, 23, 37, 0.7);
}

:root[data-theme="dark"] .execution-choice button.is-active {
  border-color: rgba(108, 188, 235, 0.28);
  background: linear-gradient(145deg, rgba(47, 79, 110, 0.9), rgba(29, 48, 70, 0.94));
}

:root[data-theme="dark"] .automatic-choice small {
  color: #8ed5ff;
}

.dialog-backdrop {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  overflow-y: auto;
  place-items: center;
  padding: 24px;
  background: rgba(71, 55, 86, 0.28);
  backdrop-filter: blur(12px) saturate(110%);
  animation: backdrop-in 180ms ease both;
}

.info-dialog {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(141, 87, 197, 0.26);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 100% 0%, rgba(67, 121, 212, 0.16), transparent 20rem),
    radial-gradient(circle at 0% 100%, rgba(213, 95, 145, 0.12), transparent 18rem),
    rgba(253, 250, 251, 0.96);
  box-shadow: 0 35px 100px rgba(70, 50, 96, 0.24);
  animation: dialog-in 220ms ease both;
}

.info-dialog::after {
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(115deg, var(--rose), transparent 24%, var(--sapphire) 54%, transparent 75%, var(--turquoise));
  background-size: 260% 260%;
  content: "";
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gemstone-edge 8s linear infinite;
}

.info-dialog__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.info-dialog__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(213, 95, 145, 0.13), rgba(67, 121, 212, 0.13));
  color: var(--amethyst);
}

.info-dialog h2 {
  max-width: 620px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.45rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.info-dialog__steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 24px 0 17px;
}

.info-dialog__steps article {
  display: flex;
  gap: 13px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.43);
}

.info-dialog__steps article > span {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(213, 95, 145, 0.12), rgba(67, 121, 212, 0.12));
  color: var(--amethyst);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
}

.info-dialog__steps h3 {
  margin: 1px 0 3px;
  font-size: 0.75rem;
}

.info-dialog__steps p,
.info-dialog__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.55;
}

.info-dialog__note {
  margin-bottom: 20px;
  padding-left: 13px;
  border-left: 2px solid rgba(29, 158, 152, 0.38);
}

.info-dialog__note--print {
  margin-top: -11px;
  border-left-color: rgba(107, 78, 190, 0.4);
}

@media (max-width: 680px) {
  .info-dialog__steps {
    grid-template-columns: 1fr;
  }
}

@keyframes button-colour {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes button-glint {
  0%,
  58% {
    left: -45%;
    opacity: 0;
  }

  66% {
    opacity: 0.8;
  }

  84%,
  100% {
    left: 125%;
    opacity: 0;
  }
}

@keyframes gemstone-edge {
  0% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 1px rgba(213, 95, 145, 0.28));
  }

  50% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 3px rgba(67, 121, 212, 0.25));
  }

  100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 1px rgba(29, 158, 152, 0.24));
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
