.python-library-post {
  --python-blue: #4b9bd3;
  --python-yellow: #ffd95a;
}

.python-library-post .article-hero__title {
  font-size: clamp(2.85rem, 7.2vw, 5.9rem);
}

.python-library-post .article-hero__image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.python-library-post .article-body {
  max-width: 54rem;
}

.python-library-post .article-body code {
  border: 1px solid rgba(232, 228, 223, 0.1);
  border-radius: 0.35rem;
  padding: 0.08rem 0.28rem;
  background: rgba(255, 255, 255, 0.055);
  color: #f5cf8a;
  font-family: var(--mono);
  font-size: 0.9em;
}

.code-block {
  position: relative;
  margin: 0 0 1.5rem;
}

.python-library-post .article-body .code-example-label {
  width: fit-content;
  margin: 0 0 0.55rem;
  border: 1px solid rgba(255, 217, 90, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.58rem;
  background: rgba(255, 217, 90, 0.055);
  color: var(--python-yellow);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.python-library-post .article-body pre {
  overflow-x: auto;
  margin: 0;
  border: 1px solid rgba(232, 228, 223, 0.1);
  border-radius: 0.75rem;
  padding: 2.7rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.26);
}

.python-library-post .article-body pre code {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f5cf8a;
  font-size: 0.84rem;
  line-height: 1.7;
}

.code-copy-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(232, 228, 223, 0.13);
  border-radius: 0.5rem;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 25, 0.88);
  color: var(--muted);
  cursor: pointer;
}

.code-copy-button:hover,
.code-copy-button:focus-visible,
.code-copy-button.is-copied {
  border-color: rgba(86, 212, 160, 0.52);
  color: #56d4a0;
}

.code-copy-button svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.article-callout {
  margin: 0 0 2rem;
  border: 1px solid rgba(86, 212, 160, 0.2);
  border-radius: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: rgba(86, 212, 160, 0.035);
}

.article-callout p:last-child,
.article-callout ul:last-child {
  margin-bottom: 0;
}

.package-builder {
  margin: 1.4rem 0 2.3rem;
  border: 1px solid rgba(75, 155, 211, 0.3);
  border-radius: 1rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  background:
    linear-gradient(135deg, rgba(75, 155, 211, 0.07), rgba(255, 217, 90, 0.025)),
    rgba(12, 12, 16, 0.62);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.24);
}

.package-builder__header {
  margin-bottom: 1.15rem;
}

.package-builder__eyebrow {
  margin-bottom: 0.35rem !important;
  color: var(--python-blue) !important;
  font-size: 0.68rem !important;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.package-builder__header h3 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.package-builder__header p:last-child {
  margin-bottom: 0;
}

.privacy-note {
  display: flex;
  margin: 0 0 1.15rem;
  border: 1px solid rgba(86, 212, 160, 0.18);
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(86, 212, 160, 0.035);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.privacy-note__icon {
  color: #56d4a0;
  font-size: 1rem;
  line-height: 1.3;
}

.file-drop-zone {
  display: grid;
  min-height: 10rem;
  border: 1px dashed rgba(75, 155, 211, 0.55);
  border-radius: 0.85rem;
  padding: 1.2rem;
  place-items: center;
  background: rgba(75, 155, 211, 0.035);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.file-drop-zone:hover,
.file-drop-zone:focus-within,
.file-drop-zone.is-dragging {
  border-color: var(--python-yellow);
  background: rgba(255, 217, 90, 0.055);
  transform: translateY(-1px);
}

.file-drop-zone.has-file {
  border-style: solid;
  border-color: rgba(86, 212, 160, 0.52);
  background: rgba(86, 212, 160, 0.045);
}

.file-drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.file-drop-zone__icon {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--python-blue);
  font-size: 2rem;
}

.file-drop-zone strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
  font-size: 0.92rem;
}

.file-drop-zone small {
  display: block;
  color: var(--faint);
  font-size: 0.68rem;
  line-height: 1.5;
}

.selected-file {
  margin: 0.65rem 0 1.25rem !important;
  color: var(--faint) !important;
  font-size: 0.72rem !important;
}

.package-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 0.42rem;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.license-picker {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.license-picker legend {
  margin-bottom: 0.42rem;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.license-options {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.license-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.license-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.license-option__name {
  display: grid;
  min-height: 3rem;
  border: 1px solid rgba(232, 228, 223, 0.14);
  border-radius: 0.55rem;
  padding: 0.58rem;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
  place-items: center;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.license-option:hover .license-option__name,
.license-option:focus-within .license-option__name {
  border-color: rgba(255, 217, 90, 0.5);
  color: var(--text);
  transform: translateY(-1px);
}

.license-option input:checked + .license-option__name {
  border-color: rgba(86, 212, 160, 0.58);
  background: rgba(86, 212, 160, 0.1);
  color: #7de3b6;
  box-shadow: inset 0 0 0 1px rgba(86, 212, 160, 0.08);
}

.license-option input:focus-visible + .license-option__name {
  outline: 2px solid rgba(75, 155, 211, 0.62);
  outline-offset: 2px;
}

.license-option__summary {
  position: absolute;
  z-index: 15;
  bottom: calc(100% + 0.55rem);
  left: 50%;
  width: min(18rem, 78vw);
  border: 1px solid rgba(255, 217, 90, 0.28);
  border-radius: 0.55rem;
  padding: 0.7rem 0.78rem;
  background: #1b1b20;
  box-shadow: 0 0.85rem 2rem rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 0.67rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.55;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 0.3rem);
  transition:
    opacity 150ms ease,
    transform 150ms ease,
    visibility 150ms ease;
  visibility: hidden;
}

.license-option:hover .license-option__summary,
.license-option:focus-within .license-option__summary {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.form-field input:not([type="radio"]),
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid rgba(232, 228, 223, 0.14);
  border-radius: 0.55rem;
  padding: 0.72rem 0.78rem;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
}

.form-field textarea {
  min-height: 5.8rem;
  resize: vertical;
}

.form-field input:not([type="radio"]):focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: rgba(75, 155, 211, 0.72);
  outline: 2px solid rgba(75, 155, 211, 0.16);
  outline-offset: 1px;
}

.form-field__hint {
  color: var(--faint);
  font-size: 0.64rem;
  line-height: 1.45;
}

.package-download-button {
  display: inline-flex;
  min-height: 3rem;
  border: 1px solid rgba(86, 212, 160, 0.48);
  border-radius: 0.65rem;
  padding: 0.7rem 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: rgba(86, 212, 160, 0.12);
  color: var(--text);
  cursor: pointer;
  font: 700 0.78rem/1.2 var(--mono);
}

.package-download-button:hover,
.package-download-button:focus-visible {
  border-color: #56d4a0;
  background: rgba(86, 212, 160, 0.18);
}

.package-download-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.packager-status {
  min-height: 1.4rem;
  margin: 0 !important;
  color: var(--faint) !important;
  font-size: 0.7rem !important;
  line-height: 1.5 !important;
}

.packager-status.is-error {
  color: #ff9292 !important;
}

.packager-status.is-success {
  color: #7de3b6 !important;
}

.package-result {
  margin-top: 1rem;
  border: 1px solid rgba(86, 212, 160, 0.2);
  border-radius: 0.65rem;
  padding: 0.85rem;
  background: rgba(86, 212, 160, 0.035);
}

.package-result p {
  margin: 0 !important;
  font-size: 0.74rem !important;
}

.token-panel {
  margin: 1.3rem 0 1.6rem;
  border: 1px solid rgba(255, 217, 90, 0.25);
  border-radius: 0.85rem;
  padding: 1rem 1.1rem;
  background: rgba(255, 217, 90, 0.035);
}

.token-panel p:last-child {
  margin-bottom: 0;
}

.token-link {
  display: inline-flex;
  min-height: 2.6rem;
  margin: 0 0 0.85rem;
  border: 1px solid rgba(255, 217, 90, 0.42);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  align-items: center;
  background: rgba(255, 217, 90, 0.07);
  color: var(--text) !important;
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none !important;
}

.terminal-platform {
  margin: 0 0 0.8rem;
  border: 1px solid rgba(232, 228, 223, 0.11);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.025);
}

.terminal-platform summary {
  padding: 0.9rem 1rem;
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.terminal-platform .code-block {
  margin: 0 0.8rem 0.8rem;
}

@media (max-width: 42rem) {
  .package-form {
    grid-template-columns: 1fr;
  }

  .form-field--full {
    grid-column: auto;
  }

  .license-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .python-library-post .article-body p,
  .python-library-post .article-body li {
    font-size: 0.9rem;
  }
}
