/* Account › Licenses: one card per studio, the license it has and Personal or Commercial to buy.
   Theme tokens only (account-theme.css), so light and dark follow the portal. */
.licenses-page { display: grid; gap: 16px; min-width: 0; }
.licenses-page p { margin: 0; text-wrap: pretty; }
.licenses-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.licenses-tiers li {
  display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--portal-line); border-radius: 14px;
  background: var(--portal-surface-soft); font-size: 13px;
}
.licenses-tiers strong { font-size: 14px; }
.licenses-tiers span { color: var(--portal-muted); }
.licenses-soon, .licenses-error {
  padding: 12px 16px; border-radius: 14px; background: var(--portal-warning-soft); color: var(--portal-warning); font-size: 14px; font-weight: 600;
}
.licenses-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; align-items: start; }

.license-studio {
  display: grid; gap: 12px; min-width: 0; padding: 18px 20px; border: 1px solid var(--portal-line); border-radius: 20px;
  background: var(--portal-surface); box-shadow: var(--portal-shadow); scroll-margin-top: 80px;
}
.license-studio-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.license-studio-head > div { flex: 1; min-width: 0; }
.license-studio-head h2 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.01em; }
.license-studio-head h2:focus { outline: none; }
.license-studio-head h2:focus-visible { outline: 2px solid var(--portal-violet-dark); outline-offset: 1px; border-radius: 4px; }
.license-now { margin-top: 2px !important; color: var(--portal-muted); font-size: 12px; }
.license-tier {
  flex: none; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap;
  border: 1px solid var(--portal-line); color: var(--portal-muted); background: var(--portal-surface);
}
.license-tier--personal { border-color: transparent; background: var(--portal-accent-soft); color: var(--portal-violet-dark); }
.license-tier--commercial { border-color: transparent; background: var(--portal-success-soft); color: var(--portal-success); }
.license-tier--owned { border-color: transparent; background: var(--portal-accent-soft); color: var(--portal-violet-dark); }
.license-note { margin: 0; color: var(--portal-muted); font-size: 13px; line-height: 1.45; }

.license-sources { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; }
.license-sources li { overflow-wrap: anywhere; }
.license-sources span { color: var(--portal-muted); font-weight: 400; }

.license-current { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--portal-surface-soft); }
.license-current.is-ended { opacity: .8; }
.license-current-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; font-size: 13px; }
.license-current-line span { color: var(--portal-muted); font-variant-numeric: tabular-nums; }
.license-kept { color: var(--portal-muted); font-size: 13px; }
.license-warning { padding: 10px 12px; border-radius: 10px; background: var(--portal-warning-soft); color: var(--portal-warning); font-size: 13px; line-height: 1.45; }
.license-link-button {
  justify-self: start; min-height: 44px; padding: 0 2px; border: 0; background: none; color: var(--portal-ink);
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.license-link-button:focus-visible, .license-buy summary:focus-visible { outline: 3px solid var(--portal-violet-dark); outline-offset: 2px; border-radius: 8px; }
.license-cancel-confirm { display: grid; gap: 10px; }
.license-cancel-confirm p { font-size: 13px; font-weight: 600; }
.license-cancel-confirm div { display: flex; flex-wrap: wrap; gap: 8px; }
.license-cancel-confirm button { min-height: 44px; }
.license-danger { background: var(--portal-danger); border-color: var(--portal-danger); color: #fff; }
html[data-theme="dark"] .license-danger { color: #19191c; }

.license-pending { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--portal-accent-soft); font-size: 13px; font-weight: 600; }
.license-pending .portal-button { justify-self: start; min-height: 44px; text-decoration: none; }

.license-buy { border-top: 1px solid var(--portal-line); }
.license-buy summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding-top: 10px;
  color: var(--portal-ink); font-size: 14px; font-weight: 650; cursor: pointer; list-style: none;
}
.license-buy summary::-webkit-details-marker { display: none; }
.license-summary-icon { font-size: 20px; line-height: 1; transition: transform 160ms ease-out; }
.license-buy[open] .license-summary-icon { transform: rotate(45deg); }
.license-buy-body { display: grid; gap: 12px; padding-top: 6px; }
.license-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.license-options.is-single { grid-template-columns: minmax(0, 1fr); }
.license-option { position: relative; display: block; cursor: pointer; }
.license-option input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.license-option-card {
  display: grid; gap: 2px; height: 100%; padding: 12px 14px; border: 1.5px solid var(--portal-line); border-radius: 14px;
  background: var(--portal-surface); transition: border-color 140ms ease-out, box-shadow 140ms ease-out;
}
.license-option-card strong { font-size: 13px; color: var(--portal-muted); }
.license-option-price { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.license-option-card small { color: var(--portal-muted); font-size: 12px; line-height: 1.35; }
.license-option:hover .license-option-card { border-color: var(--portal-muted); }
.license-option input:checked + .license-option-card { border-color: var(--portal-violet-dark); box-shadow: 0 0 0 3px var(--portal-accent-soft); }
.license-option input:focus-visible + .license-option-card { outline: 3px solid var(--portal-violet-dark); outline-offset: 3px; }
.license-option input:disabled, .license-option input:disabled + .license-option-card { cursor: not-allowed; opacity: .6; }
.license-agreement { color: var(--portal-muted); font-size: 12.5px; line-height: 1.45; }
.license-agreement a { color: var(--portal-ink); }
.license-pay-methods { color: var(--portal-muted); font-size: 12.5px; text-align: center; }
.license-pay-row { display: grid; gap: 6px; }
.license-pay { min-height: 46px; width: 100%; justify-content: center; }
.license-pay[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.license-status { min-height: 0; color: var(--portal-muted); font-size: 13px; }
.license-status:empty { display: none; }
.licenses-plan { padding: 12px 16px; border: 1px dashed var(--portal-line); border-radius: 14px; color: var(--portal-muted); font-size: 13px; }
.licenses-plan a { color: var(--portal-ink); font-weight: 600; }

@media (max-width: 520px) {
  .licenses-tiers { grid-template-columns: minmax(0, 1fr); }
  .license-studio { padding: 16px; border-radius: 18px; }
  .license-option-price { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .license-summary-icon, .license-option-card { transition: none; }
}
