.id-badge-mounted > .tool-titlebar,
.id-badge-mounted .tool-titlebar + .timestamp-grid {
  display: none;
}

.id-badge-workbench {
  width: min(100% - 48px, 1440px) !important;
}

.id-badge-shell {
  display: grid;
  grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.id-badge-panel {
  overflow: hidden;
  border: 1px solid rgba(207, 219, 240, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 22px 70px rgba(36, 80, 150, 0.1);
}

.id-badge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(224, 232, 246, 0.95);
  background: linear-gradient(180deg, #fff, #f7faff);
}

.id-badge-head h2,
.id-badge-form h3 {
  margin: 0;
  color: #07142f;
}

.id-badge-head h2 {
  font-size: 18px;
}

.id-badge-head span {
  display: block;
  margin-top: 4px;
  color: #6c7d9f;
  font-size: 13px;
}

.id-badge-head button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d7e2f5;
  border-radius: 10px;
  background: #fff;
  color: #38527d;
  font-size: 13px;
  cursor: pointer;
}

.id-badge-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.id-badge-form section {
  display: grid;
  gap: 12px;
}

.id-badge-form h3 {
  font-size: 15px;
}

.id-badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.id-badge-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.id-badge-field {
  display: grid;
  gap: 7px;
  color: #405b88;
  font-size: 13px;
  font-weight: 700;
}

.id-badge-field.wide {
  grid-column: 1 / -1;
}

.id-badge-field input,
.id-badge-field select {
  width: 100%;
  height: 42px;
  border: 1px solid #bdd0f4;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #081631;
  padding: 0 12px;
  font: inherit;
  font-weight: 500;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.id-badge-field input:focus,
.id-badge-field select:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.1);
}

.id-badge-segment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.id-badge-segment button,
.id-badge-theme,
.id-badge-actions button {
  border: 1px solid #d7e2f5;
  background: #fff;
  color: #37527e;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.id-badge-segment button {
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.id-badge-segment button.active,
.id-badge-theme.active {
  border-color: rgba(22, 119, 255, 0.72);
  background: #f1f7ff;
  box-shadow: 0 12px 30px rgba(22, 119, 255, 0.12);
}

.id-badge-themes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.id-badge-theme {
  min-height: 70px;
  border-radius: 14px;
  padding: 10px 8px;
  display: grid;
  place-items: center;
  gap: 7px;
  font-size: 12px;
}

.id-badge-theme i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.id-badge-upload {
  height: 48px;
  border-radius: 14px;
  border: 1px dashed #9fb9e8;
  background: linear-gradient(180deg, #f8fbff, #fff);
  color: #315489;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.id-badge-upload input {
  display: none;
}

.id-badge-upload svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.id-badge-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
}

.id-badge-actions button {
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}

.id-badge-actions button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #1677ff, #7257ff);
  color: #fff;
  box-shadow: 0 14px 32px rgba(45, 111, 255, 0.22);
}

.id-badge-segment button:hover,
.id-badge-theme:hover,
.id-badge-actions button:hover,
.id-badge-head button:hover {
  transform: translateY(-1px);
  border-color: rgba(22, 119, 255, 0.52);
}

.id-badge-preview-panel {
  min-height: 720px;
}

.id-badge-preview {
  min-height: 650px;
  display: grid;
  place-items: center;
  padding: 36px;
  background:
    radial-gradient(circle at 20% 18%, rgba(92, 147, 255, 0.12), transparent 30%),
    radial-gradient(circle at 78% 82%, rgba(126, 87, 255, 0.12), transparent 34%),
    linear-gradient(135deg, #f7faff, #ffffff 54%, #f3f7ff);
}

.id-badge-card {
  position: relative;
  width: var(--badge-w);
  height: var(--badge-h);
  overflow: hidden;
  border-radius: 28px;
  color: #07142f;
  background: #fff;
  box-shadow: 0 32px 80px rgba(15, 36, 80, 0.22), inset 0 0 0 1px rgba(210, 220, 238, 0.95);
}

.id-badge-ribbon {
  position: absolute;
  inset: 0 0 auto;
  height: 132px;
  background:
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(135deg, var(--badge-grad-a), var(--badge-grad-b));
}

.id-badge-card.horizontal .id-badge-ribbon {
  height: 92px;
}

.id-badge-ribbon::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 32px solid rgba(255, 255, 255, 0.16);
}

.id-badge-hole {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 2px 6px rgba(23, 52, 103, 0.18);
}

.id-badge-card-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 30px 26px 0;
  color: #fff;
}

.id-badge-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.id-badge-card-head b {
  display: block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}

.id-badge-card-head span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.id-badge-person {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding: 48px 34px 0;
}

.id-badge-card.horizontal .id-badge-person {
  grid-template-columns: 122px minmax(0, 1fr);
  justify-items: stretch;
  align-items: start;
  gap: 18px;
  padding: 26px 32px 0;
}

.id-badge-photo {
  width: 116px;
  height: 116px;
  border-radius: 26px;
  padding: 6px;
  background: var(--badge-soft);
  box-shadow: 0 18px 42px rgba(26, 84, 170, 0.2);
}

.id-badge-card.horizontal .id-badge-photo {
  width: 112px;
  height: 112px;
}

.id-badge-photo img,
.id-badge-photo span {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: var(--badge-accent);
  color: #fff;
  font-size: 54px;
  font-weight: 900;
}

.id-badge-info {
  width: 100%;
  min-width: 0;
  margin-top: 18px;
  text-align: center;
}

.id-badge-card.horizontal .id-badge-info {
  margin-top: 0;
  text-align: left;
}

.id-badge-info h2 {
  margin: 0;
  color: #07142f;
  font-size: 34px;
  line-height: 1.1;
}

.id-badge-info p {
  margin: 8px 0 18px;
  color: var(--badge-accent);
  font-size: 17px;
  font-weight: 800;
}

.id-badge-info dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.id-badge-info dl div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 30px;
  border-radius: 10px;
  background: #f8fafc;
  padding: 5px 10px;
}

.id-badge-info dt,
.id-badge-info dd {
  margin: 0;
}

.id-badge-info dt {
  color: #8593aa;
  font-size: 12px;
}

.id-badge-info dd {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #17233b;
  font-size: 14px;
  font-weight: 800;
}

.id-badge-code {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: grid;
  justify-items: center;
  gap: 7px;
}

.id-badge-card.horizontal .id-badge-code {
  left: auto;
  right: 26px;
  bottom: 24px;
}

.id-badge-qr {
  width: 76px;
  height: 76px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  border-radius: 16px;
  background: #f8fafc;
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(221, 229, 242, 0.95);
}

.id-badge-qr i {
  border-radius: 2px;
}

.id-badge-qr i.on {
  background: var(--badge-deep);
}

.id-badge-code span {
  color: #7d8aa2;
  font-size: 11px;
}

.id-badge-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(7, 20, 47, 0.92);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.id-badge-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.id-badge-print-root {
  display: none;
}

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

  .id-badge-grid,
  .id-badge-grid.compact,
  .id-badge-actions {
    grid-template-columns: 1fr;
  }

  .id-badge-preview {
    padding: 20px;
    overflow: auto;
  }
}

@media print {
  body.id-badge-printing > *:not(.id-badge-print-root) {
    display: none !important;
  }

  body.id-badge-printing,
  body.id-badge-printing .id-badge-print-root {
    display: block;
    margin: 0;
    background: #fff;
  }

  .id-badge-print-root {
    padding: 18mm;
  }

  .id-badge-print-root section {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 36mm);
  }

  .id-badge-card {
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
