/* License Manager layout & account panel — shares homepage tokens and light/dark theme. */
.license-page main {
  width: min(100% - 64px, 1180px);
  margin: 0 auto;
  padding: 64px 0 88px;
}

.sign-in {
  max-width: 540px;
  margin: 0 auto;
}
.sign-in .page-hero { margin-bottom: 36px; }
.sign-in .page-hero h1 { font-size: clamp(44px, 5.5vw, 64px); }
.sign-in strong { overflow-wrap: anywhere; color: var(--ink); }
.sign-in .purchase p:last-of-type { margin-bottom: 0; }
.sign-in .purchase button[type="submit"] + p { margin-top: 16px; font-size: 13px; text-align: center; }

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
}
#code {
  letter-spacing: .25em;
  font-variant-numeric: tabular-nums;
}

.license-page .text-button {
  background: transparent;
  color: var(--accent-ink);
  font-size: 14px;
  padding: 6px 0;
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}
.license-page .text-button:disabled {
  background: none;
  color: var(--muted);
  cursor: default;
}

/* Header sign-out button when authenticated */
.site-header .logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

/* Signed-in account context & single-panel view */
.account-context {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.account-context p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.account-context > p {
  color: var(--ink);
  font-weight: 600;
  flex-shrink: 0;
}
.account-context > div {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.account-context select {
  border: 1px solid var(--line);
  padding: 7px 14px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 100px;
  font: inherit;
  font-size: 13px;
  max-width: 100%;
}

.license-panel {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--line), var(--card-shadow);
  overflow: hidden;
}
.license-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  padding: 38px 42px;
  border-bottom: 1px solid var(--line);
}
.license-identity { min-width: 0; }
.product-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.product-title h1 {
  font-size: 36px;
  letter-spacing: -.045em;
  line-height: 1.15;
  margin: 0;
  font-weight: 600;
}
.product-title h1 span {
  font-size: 18px;
  letter-spacing: -.02em;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}

.license-state {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 11px;
  background: var(--surface-subtle);
  border-radius: 100px;
}
.license-state[data-state="active"] {
  color: #35603c;
  background: #e9f2ea;
}
html[data-theme="dark"] .license-state[data-state="active"] {
  color: #a9d3aa;
  background: #223023;
}

.license-key-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 14px;
}
.license-key-row code {
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  background: var(--canvas);
  padding: 5px 12px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--line);
  overflow-wrap: anywhere;
}
.license-key-row .text-button { min-width: 55px; min-height: 32px; }

.download-action { flex-shrink: 0; text-align: center; }
.download-action button {
  margin: 0;
  width: auto;
  padding: 0 24px;
  min-height: 46px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  background: #292823;
  color: #faf9f5;
}
html[data-theme="dark"] .download-action button {
  background: #efeeeb;
  color: #252421;
}
.download-action button:disabled {
  background: var(--surface-subtle);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 1;
  cursor: default;
}
.download-action span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.license-body {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 440px;
}
.license-details {
  padding: 34px 32px 36px 42px;
  border-right: 1px solid var(--line);
}
.license-details dl { margin: 0; }
.license-details dl > div + div { margin-top: 26px; }
.license-details dt,
.device-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.license-details dd {
  margin: 6px 0 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.license-details dd a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}
.license-details dd .text-button { min-height: 30px; }
.license-details .detail-note {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.ownership-note {
  font-size: 12px;
  color: var(--muted);
  margin: 34px 0 0;
  line-height: 1.8;
}

.device-section { padding: 34px 40px; min-width: 0; }
.device-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  text-align: left;
}
.device-table th {
  padding: 10px 10px 20px 0;
  border-bottom: 1px solid var(--line);
}
.device-table th:first-child { width: 35%; }
.device-table th:last-child { width: 115px; }
.device-table td {
  font-size: 14px;
  vertical-align: top;
  padding: 22px 10px 22px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.device-table td:first-child { font-weight: 600; overflow-wrap: anywhere; }
.device-table td:last-child { padding-right: 0; }
.device-table .text-button {
  color: var(--accent-ink);
  font-size: 13px;
  min-height: 32px;
  margin-top: -5px;
}
.device-table .device-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.device-table .cancel-unlink { color: var(--muted); font-size: 12px; }
.device-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  margin: 22px 0 0;
  max-width: 460px;
}
.empty-devices { margin: 32px 0; font-weight: 600; font-size: 16px; }
.empty-devices span {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 8px;
}

.renew-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line), var(--card-shadow);
  padding: 28px 34px;
  border-radius: 24px;
  margin-top: 20px;
}
.renew-confirm h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.03em;
  margin: 0 0 6px;
}
.renew-confirm p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.confirm-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.confirm-actions .button { margin-top: 0; width: auto; padding: 12px 24px; min-height: 46px; }
.confirm-actions .text-button { text-align: center; }

.license-page #status {
  text-align: center;
  font-size: 13px;
  min-height: 24px;
  margin: 22px 0 0;
  color: var(--muted);
}
.license-page .support {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

@media (hover: hover) {
  .license-page .text-button:hover:not(:disabled),
  .license-details dd a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
  .site-header .logout-button:hover {
    color: var(--ink);
    background: var(--surface-subtle);
  }
}

@media (max-width: 1050px) {
  .license-page main { width: calc(100% - 48px); }
  .license-heading { padding: 32px; }
  .license-body { grid-template-columns: 240px minmax(0, 1fr); }
  .license-details { padding: 28px 24px 32px 32px; }
  .device-section { padding: 28px 24px; }
  .device-table th { font-size: 10px; }
  .device-table td { font-size: 13px; }
  .device-table th:last-child { width: 95px; }
}

@media (max-width: 760px) {
  .license-page main { width: calc(100% - 36px); padding: 36px 0 64px; }
  .account-context { flex-direction: column; align-items: stretch; gap: 6px; margin-bottom: 14px; }
  .account-context > div { justify-content: flex-start; }
  .license-heading { align-items: flex-start; flex-direction: column; gap: 22px; padding: 26px 24px; }
  .product-title h1 { font-size: 30px; }
  .license-key-row { gap: 6px 12px; }
  .license-key-row code { font-size: 12px; }
  .download-action { text-align: left; }
  .license-body { display: block; min-height: 0; }
  .license-details { padding: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .license-details dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
  .license-details dl > div + div { margin-top: 0; }
  .license-details dt { font-size: 10px; }
  .license-details dd { font-size: 14px; }
  .ownership-note { margin-top: 22px; }
  .ownership-note br { display: none; }
  .device-section { padding: 12px 24px 24px; }
  .device-table thead { display: none; }
  .device-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
  }
  .device-table td { display: block; border: 0; padding: 0; font-size: 13px; }
  .device-table td:first-child { grid-column: 1 / -1; font-size: 15px; }
  .device-table td[data-label]::before {
    display: block;
    content: attr(data-label);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .device-table td:last-child { grid-column: 1 / -1; margin-top: 4px; }
  .device-table .device-actions { flex-direction: row; gap: 18px; align-items: center; }
  .device-table .text-button { min-height: 40px; margin: 0; }
  .renew-confirm { flex-direction: column; align-items: stretch; padding: 24px; gap: 18px; }
  .confirm-actions { align-items: stretch; }
  .confirm-actions .button { width: 100%; }
}
