:root {
  --pink: #f46ea4;
  --pink-dark: #d94582;
  --gold: #f4b42d;
  --purple: #8c2c89;
  --teal: #0f8f8c;
  --ink: #241a26;
  --muted: #6f6470;
  --paper: #fffafc;
  --line: #eadfe6;
  --shadow: 0 18px 50px rgba(36, 26, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(244, 180, 45, 0.12), transparent 33%),
    linear-gradient(245deg, rgba(15, 143, 140, 0.1), transparent 38%),
    #fff7fb;
  font-family: Arial, Helvetica, sans-serif;
}

body.locked {
  overflow: hidden;
}

body.locked .app-shell {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

button,
input,
select {
  font: inherit;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(115deg, rgba(244, 180, 45, 0.18), transparent 36%),
    linear-gradient(245deg, rgba(244, 110, 164, 0.18), transparent 42%),
    rgba(255, 247, 251, 0.94);
}

body:not(.locked) .access-gate {
  display: none;
}

.access-card {
  width: min(100%, 430px);
  padding: 34px;
  background: #fff;
  border: 8px solid var(--pink);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.access-card h1 {
  color: var(--pink);
  font-family: "Poppins", Arial, Helvetica, sans-serif;
}

.access-intro {
  margin: 12px 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.access-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 700;
}

.access-card input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fffafc;
}

.access-card input:focus {
  outline: 3px solid rgba(244, 110, 164, 0.24);
  border-color: var(--pink);
}

.access-error {
  min-height: 20px;
  margin: 2px 0 14px;
  color: var(--pink-dark);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.workspace,
.palette-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(234, 223, 230, 0.9);
  box-shadow: var(--shadow);
}

.workspace {
  min-height: calc(100vh - 48px);
  padding: 22px;
}

.palette-panel {
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.topbar,
.palette-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--pink-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  font-size: 22px;
}

h3 {
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

button {
  border: 0;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--ink);
  color: #fff;
}

.ghost-button {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.full-width {
  width: 100%;
}

.signature-card {
  margin-top: 36px;
  overflow-x: auto;
  padding: 24px 12px 30px;
}

.signature {
  position: relative;
  width: min(100%, 980px);
  aspect-ratio: 532 / 240;
  min-width: 620px;
  margin: 0 auto;
  background: #fff;
  border: 18px solid var(--pink);
  border-radius: 42px;
  font-family: "Poppins", Arial, Helvetica, sans-serif;
}

.brand-title {
  position: absolute;
  top: 17px;
  right: 68px;
  color: var(--pink);
  background: transparent;
  padding: 0;
  font-size: clamp(22px, 3.3vw, 36px);
  font-weight: 500;
  line-height: 1;
  z-index: 3;
}

.brand-title sup {
  font-size: 40%;
  top: -0.55em;
  position: relative;
}

.rail {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 48%;
  height: 11px;
  border-radius: 999px;
  background: var(--pink);
  transform: translateY(-50%);
}

.slot {
  position: absolute;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 0;
}

.grid-marker {
  position: absolute;
  top: 35.45%;
  width: 3px;
  height: 88px;
  border-radius: 999px;
  background: var(--slot-color, var(--gold));
  transform: translateX(-50%);
  pointer-events: none;
}

.slot-top {
  top: 31%;
}

.slot-bottom {
  top: 53.25%;
}

.slot::before {
  display: none;
}

.slot.drop-target::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px dashed var(--pink-dark);
  background: rgba(244, 110, 164, 0.08);
}

.placed-icon {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(36, 26, 38, 0.16);
}

.soft-side-mark {
  position: absolute;
  left: 18px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #e68eb2;
  font-size: 15px;
  font-weight: 700;
}

.soft-side-text em {
  font-style: italic;
}

.soft-side-mark img {
  width: 28px;
  height: 25px;
  object-fit: contain;
  display: block;
}

.selection-summary {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  min-height: 22px;
}

.rights-notice {
  max-width: 860px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.search-box {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.search-box input,
.custom-icon-form input,
.custom-icon-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 0 12px;
}

.category-chooser.collapsed {
  display: none;
}

.category-tab {
  min-height: 42px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  text-align: left;
  display: grid;
  gap: 2px;
}

.category-tab.active {
  color: #fff;
  border-color: var(--pink-dark);
  background: var(--pink-dark);
}

.category-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.category-count {
  font-size: 11px;
  font-weight: 400;
}

.category-helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.active-category-title {
  margin: 0;
}

.active-category-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.change-category {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--pink-dark);
  font-size: 12px;
}

.icon-palette {
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 2px 18px;
}

.icon-card {
  min-height: 88px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
  cursor: grab;
}

.icon-card:active {
  cursor: grabbing;
}

.icon-card img {
  width: 52px;
  height: 52px;
}

.icon-name {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 700;
}

.icon-category {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.custom-icon-form {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 10px;
}

.custom-icon-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: auto;
  }

  .palette-panel {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100vw - 20px, 1360px);
    padding: 10px 0;
    gap: 12px;
  }

  .workspace,
  .palette-panel {
    padding: 14px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }

  h1 {
    font-size: 28px;
  }

  .signature-card {
    padding-left: 0;
    padding-right: 0;
  }

  .icon-palette {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    grid-template-columns: 1fr;
  }

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