@layer design {
  .api-key-panel { padding:30px; border-radius:22px; }
  .api-panel-title { display:flex; align-items:center; gap:15px; min-width:0; }
  .api-panel-title .api-panel-icon { flex:none; margin:0; width:52px; height:52px; border:1px solid color-mix(in srgb,var(--accent) 22%,transparent); border-radius:15px; }
  .extra-section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:22px; }
  .extra-section-heading h2 { margin:0; font-size:25px; letter-spacing:-.025em; }
  .extra-section-heading p { margin:8px 0 0; font-size:14px; }
  .extra-eyebrow { display:block; margin-bottom:7px; font-size:12px; color:var(--accent); }
  .api-access-status { display:inline-flex; align-items:center; gap:8px; flex:none; padding:8px 11px; border:1px solid var(--line); border-radius:9px; color:var(--muted); font-size:12px; }
  .api-access-status i { width:6px; height:6px; background:currentColor; border-radius:50%; }
  .api-access-status.is-enabled { color:var(--positive-ink); border-color:color-mix(in srgb,var(--positive-ink) 23%,transparent); background:color-mix(in srgb,var(--positive-ink) 7%,transparent); }
  .api-intro { margin:0; color:var(--muted); line-height:1.7; font-size:15px; }
  .api-mode-note { display:flex; align-items:center; gap:12px; padding:14px 16px; margin-top:18px; background:color-mix(in srgb,var(--accent) 4%,transparent); border:1px solid var(--line); border-radius:12px; }
  .api-mode-note>svg { width:21px; height:21px; flex:none; color:var(--accent); }.api-mode-note p { margin:0; font-size:12px; line-height:1.65; }.api-mode-note b { display:block; color:var(--accent); font-weight:550; margin-bottom:2px; }.api-mode-note span { color:var(--muted); }
  .extra-demo-note { font-size:12px; color:var(--muted); line-height:1.6; margin:12px 0 0; }
  .api-linked { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:13px; color:var(--accent); }
  .api-linked svg { width:18px; height:18px; }
  .api-key-box { margin-top:26px; }
  .api-key-box label { display:block; font-weight:600; font-size:14px; margin-bottom:12px; }
  .api-key-value { display:flex; align-items:center; gap:8px; padding:8px; background:var(--surface-2,var(--surface)); border:1px solid var(--line); border-radius:13px; }
  .api-key-value input { min-width:0; flex:1; width:100%; border:0; background:none; font-family:monospace; font-size:15px; padding:12px 8px; color:var(--ink); }
  .api-key-value .icon-button { width:42px; height:42px; flex:none; padding:10px; }
  .api-key-value .button { min-height:42px; font-size:13px; padding:10px 14px; color:var(--accent); background:var(--soft); border-color:transparent; }
  .api-key-hint { font-size:12px; line-height:1.6; color:var(--muted); margin:11px 0 24px; }
  .api-stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
  .api-stat-grid>div { display:flex; flex-direction:column; gap:9px; padding:16px 18px; border:1px solid var(--line); border-radius:13px; background:color-mix(in srgb,var(--ink) 2%,transparent); }
  .api-stat-grid span { font-size:12px; color:var(--muted); }
  .api-stat-grid strong { font-size:25px; line-height:1.4; font-variant-numeric:tabular-nums; }
  .api-stat-grid strong small { font-size:12px; font-weight:400; color:var(--muted); }
  .api-stat-grid .api-date { font-size:15px; padding-top:5px; }
  .api-key-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:24px; }
  .api-key-actions .button { min-height:46px; font-size:14px; }
  .api-key-panel .form-error.success { color:var(--accent); background:var(--soft); border-color:var(--line); }
  .api-key-panel [data-extra-message]:not([hidden]) { margin-top:20px; }
  .api-rotate-wait { display:flex; align-items:center; gap:8px; margin:13px 0 0; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }.api-rotate-wait svg { width:15px; height:15px; color:var(--accent); flex:none; }
  .api-resource-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:18px; }
  .api-resource { display:flex; align-items:center; gap:14px; padding:22px; border-radius:17px; }
  .api-resource>svg { width:24px; height:24px; color:var(--accent); flex:none; }
  .api-resource>svg:last-child { margin-left:auto; width:18px; }
  .api-resource-icon { display:grid; place-items:center; flex:none; width:42px; height:42px; border-radius:12px; color:var(--accent); background:var(--soft); }.api-resource-icon svg { width:21px; height:21px; }
  .api-resource b { font-size:15px; color:var(--ink); }
  .api-resource small { display:block; font-size:12px; color:var(--muted); margin-top:6px; line-height:1.5; }
  .api-resource:hover { border-color:var(--line-hover); }
  .api-panel-icon { display:grid; place-items:center; width:48px; height:48px; background:var(--soft); color:var(--accent); border-radius:13px; margin-bottom:18px; }
  .api-panel-icon svg { width:24px; height:24px; }
  body:has(.account-action-dialog[open]) { overflow:hidden; }
  html:has(.account-action-dialog[open]) { overflow:hidden; }
  .account-action-dialog { box-sizing:border-box; width:min(780px,calc(100% - 32px)); max-width:none; max-height:calc(100dvh - 32px); margin:auto; padding:28px; overflow:auto; overscroll-behavior:contain; border:1px solid var(--line-hover); border-radius:24px; background:var(--surface); color:var(--ink); box-shadow:0 20px 60px #0005; }
  .account-action-dialog::backdrop { background:#06081190; backdrop-filter:blur(5px); }
  .account-action-dialog>header { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:24px; }
  .account-action-dialog h2 { font-size:27px; line-height:1.3; letter-spacing:-.03em; margin:0; outline:none; }
  .account-action-dialog h2:has(.preorder-status-mark) { display:flex; align-items:center; gap:14px; }
  .preorder-status-mark { display:block; width:48px; height:48px; flex:none; color:var(--accent); }
  .preorder-status-mark .payment-status-mark { display:block; width:48px; height:48px; overflow:visible; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .account-action-dialog>header .icon-button { width:38px; height:38px; flex:none; padding:9px; border:1px solid var(--line); border-radius:11px; }
  .account-action-content .order-product-cover { margin-bottom:24px; min-height:190px; }
  .account-action-dialog .order-cover-character { max-height:100%; }
  .account-action-content .button { min-height:46px; font-size:14px; }
  .account-action-content .form-error { font-size:13px; line-height:1.6; }
  .extra-dialog-actions { display:flex; gap:12px; margin-top:22px; }
  .extra-dialog-actions>.button { flex:1; }
  .extra-support { width:100%; margin-top:13px; color:var(--accent); }
  .extra-details { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); }
  .extra-details summary { color:var(--muted); font-size:13px; cursor:pointer; }
  .extra-details dl { background:var(--soft); border:1px solid var(--line); border-radius:12px; padding:16px; display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px 20px; font-size:12px; }
  .extra-details dt { color:var(--muted); }.extra-details dd { margin:0; text-align:right; overflow-wrap:anywhere; }
  .preorder-state-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:20px 0; font-size:12px; color:var(--muted); }
  .account-order-status.is-pending { color:var(--accent); background:var(--soft); border-color:color-mix(in srgb,var(--accent) 24%,transparent); }
  .account-order-status.is-canceled { color:var(--muted); background:none; border-color:var(--line); }
  .preorder-progress { padding:17px 18px; border:1px solid var(--line); border-radius:13px; }
  .preorder-progress>div { display:flex; justify-content:space-between; gap:10px; font-size:13px; }.preorder-progress span { color:var(--muted); }
  .preorder-progress progress { display:block; width:100%; height:4px; border:0; border-radius:4px; margin-top:14px; overflow:hidden; background:var(--line); accent-color:var(--accent); }
  .preorder-progress progress::-webkit-progress-bar { background:var(--line); }.preorder-progress progress::-webkit-progress-value { background:var(--accent); }
  .preorder-money-row { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:24px 0 12px; }.preorder-money-row span { font-size:14px; color:var(--muted); }.preorder-money-row strong { font-size:30px; letter-spacing:-.03em; }
  .preorder-explanation { font-size:14px; line-height:1.75; }
  .preorder-form-row { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:22px 0; font-size:14px; }
  .preorder-form-row input { width:100px; text-align:center; padding:12px; font-size:17px; appearance:textfield; }.preorder-form-row input::-webkit-inner-spin-button { appearance:none; }
  .preorder-terms { display:flex; align-items:center; gap:10px; font-size:13px; margin:22px 0; line-height:1.6; }
  .preorder-terms input { accent-color:var(--accent); width:17px; height:17px; }
  .preorder-list-meta { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; column-gap:16px; margin:16px 0; }
  .preorder-list-meta .account-order-count { margin:0; }
  .preorder-test-link { display:inline-flex; align-items:center; gap:8px; min-height:24px; color:var(--accent); font-size:12px; }
  .preorder-test-link svg { width:15px; height:15px; flex:none; }
  .account-order-progress { color:var(--accent); font-size:12px; margin:12px 0 0; }
  .stock-badge.preorder,.availability--preorder { color:var(--accent); background:var(--soft); border-color:var(--line-hover); }
  .preorder-purchase-hint { text-align:center; font-size:12px; color:var(--muted); line-height:1.6; margin:12px 0 0; }
  .preorder-dialog { width:min(var(--commerce-dialog-width,620px),calc(100% - 32px)); padding:0; border-radius:24px; scrollbar-width:thin; scrollbar-color:var(--line-hover) transparent; }
  .preorder-dialog>[data-extra-close] { position:absolute; z-index:2; top:20px; right:20px; width:38px; height:38px; padding:9px; border:1px solid var(--line); border-radius:11px; }
  .preorder-dialog>.preorder-stage-heading { display:block; padding:24px 56px; margin:0; border-bottom:1px solid var(--line); background:radial-gradient(ellipse at 5% 0%,color-mix(in srgb,var(--primary) 10%,transparent),transparent 80%); text-align:center; }
  .preorder-heading-row { display:flex; align-items:center; justify-content:center; gap:14px; }
  .preorder-heading-row .receipt-visual { display:grid; place-items:center; position:static; width:60px; height:60px; flex:0 0 60px; margin:0; border:0; border-radius:0; background:none; box-shadow:none; color:var(--accent); }
  .preorder-heading-row .receipt-visual::before,.preorder-heading-row .receipt-visual::after { content:none; animation:none; }
  .preorder-dialog .preorder-heading-row h2 { font-size:28px; font-weight:550; line-height:1.25; letter-spacing:-.035em; }
  .preorder-stage-heading>p { font-size:15px; line-height:1.65; color:var(--muted); margin:14px 0 0; }
  .preorder-dialog>.account-action-content { padding:24px; }
  .preorder-dialog .order-product-cover { width:100%; min-width:0; min-height:220px; margin:0 0 24px; }
  .preorder-dialog .order-cover-character { max-height:none; }
  .preorder-dialog .preorder-form-row { margin:22px 0; }.preorder-dialog .preorder-form-row .quantity-stepper { width:136px; }
  .preorder-dialog .preorder-form-row .quantity-stepper input { padding:10px 0; width:44px; font-size:16px; background:none; border:0; min-height:42px; }
  .preorder-reserve-note { display:flex; align-items:center; gap:14px; padding:16px; background:color-mix(in srgb,var(--accent) 5%,var(--surface)); border:1px solid var(--line); border-radius:13px; }
  .preorder-reserve-note>svg { width:23px; height:23px; flex:none; color:var(--accent); }
  .preorder-reserve-note p { margin:0; font-size:14px; font-weight:600; }.preorder-reserve-note span { display:block; margin-top:5px; font-weight:400; font-size:13px; line-height:1.65; color:var(--muted); }
  .preorder-dialog .preorder-money-row { padding-top:6px; margin:24px 0 12px; }.preorder-dialog .preorder-money-row strong { font-size:36px; }
  .preorder-dialog .extra-demo-note { text-align:center; margin-top:14px; }
  .preorder-wallet-summary { display:flex; align-items:center; gap:12px; padding:15px 16px; margin:18px 0 22px; border:1px solid var(--line); border-radius:14px; background:color-mix(in srgb,var(--accent) 4%,var(--surface)); }
  .preorder-wallet-icon { display:grid; place-items:center; flex:none; width:40px; height:40px; border-radius:11px; background:var(--soft); color:var(--accent); }.preorder-wallet-icon svg { width:21px; height:21px; }
  .preorder-wallet-summary>div { min-width:0; }.preorder-wallet-summary>div>span { display:block; margin-bottom:5px; font-size:12px; color:var(--muted); }.preorder-wallet-summary strong { display:block; font-size:19px; line-height:1.3; font-weight:550; font-variant-numeric:tabular-nums; }
  .preorder-wallet-after { margin-left:auto; text-align:right; }.preorder-wallet-after strong { color:var(--accent); }.preorder-wallet-summary.is-insufficient .preorder-wallet-after strong { color:var(--negative-ink,#e7a0ab); }
  .preorder-dialog .preorder-state-row { margin-top:-8px; margin-bottom:20px; }
  .preorder-demo-actions { padding:18px; margin:24px 0 0; border:1px solid var(--line); border-radius:18px; background:color-mix(in srgb,var(--ink) 2%,transparent); }
  .preorder-demo-actions>p { margin:0 0 15px; font-size:13px; line-height:1.6; color:var(--muted); }
  .preorder-demo-actions .extra-dialog-actions { margin:0; }.preorder-demo-actions .button-primary { flex:1; }.preorder-demo-actions .button-secondary { flex:0 0 auto; }
  .preorder-dialog .extra-details { margin-top:26px; padding-top:22px; }.preorder-dialog .extra-details>summary { display:flex; gap:7px; align-items:center; list-style:none; }.preorder-dialog .extra-details>summary::-webkit-details-marker { display:none; }
  .preorder-dialog .extra-details summary svg { width:17px; height:17px; transition:transform .18s; }.preorder-dialog .extra-details[open] summary svg { transform:rotate(180deg); }
  .preorder-reference { margin-top:20px; border:1px solid var(--line); background:color-mix(in srgb,var(--ink) 2%,transparent); border-radius:13px; padding:16px; }
  .preorder-reference>span { color:var(--muted); font-size:12px; }.preorder-reference>div { display:flex; align-items:center; gap:14px; justify-content:space-between; margin-top:12px; }.preorder-reference code { font-size:12px; overflow-wrap:anywhere; min-width:0; }.preorder-reference .icon-button { width:36px; height:36px; flex:none; padding:8px; border:1px solid var(--line); border-radius:9px; }.preorder-reference small { display:block; font-size:11px; color:var(--muted); margin-top:10px; }
  .preorder-dialog .extra-support { margin-top:24px; min-height:50px; border-color:var(--line-hover); background:color-mix(in srgb,var(--accent) 4%,transparent); }
  @media(max-width:700px) {
    .account-page .account-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; overflow:visible; }
    .account-page .account-tabs a { min-width:0; min-height:58px; white-space:nowrap; padding:9px 6px; font-size:11px; gap:5px; }
    .api-key-panel { padding:20px; border-radius:18px; }
    .api-panel-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; }.api-panel-title { gap:10px; }.api-panel-title .api-panel-icon { width:40px; height:40px; border-radius:12px; }.api-panel-title .extra-eyebrow { font-size:10px; margin-bottom:4px; }.api-panel-title h2 { font-size:20px; }
    .extra-section-heading { align-items:flex-start; flex-wrap:wrap; gap:12px; margin-bottom:18px; }.extra-section-heading h2 { font-size:22px; }
    .api-access-status { font-size:11px; padding:6px 9px; }.api-intro { font-size:14px; }
    .api-key-value { gap:3px; }.api-key-value input { font-size:13px; padding:10px 4px; }.api-key-value .button { padding:10px; width:40px; }.api-key-value .button span { display:none; }.api-key-value .icon-button { width:36px; }
    .api-stat-grid { grid-template-columns:1fr 1fr; gap:20px 12px; }.api-stat-grid>div:last-child { grid-column:1/-1; flex-direction:row; align-items:center; justify-content:space-between; }.api-stat-grid .api-date { padding:0; font-size:13px; }
    .api-key-actions { flex-direction:column; }.api-resource-grid { grid-template-columns:1fr; gap:12px; }.api-resource { padding:18px; }
    .account-action-dialog { width:calc(100% - 20px); max-height:calc(100dvh - 24px); padding:20px; border-radius:21px; }.account-action-dialog h2 { font-size:23px; }.account-action-dialog>header { margin-bottom:20px; }
    .account-action-content .order-product-cover { min-height:160px; }.preorder-explanation { font-size:13px; }.preorder-money-row strong { font-size:27px; }
    .extra-dialog-actions { flex-direction:column; gap:10px; }.extra-details dl { grid-template-columns:1fr; gap:8px; }.extra-details dd { text-align:left; }.extra-details dt:not(:first-child) { margin-top:6px; }
    .preorder-list-meta { row-gap:8px; }.preorder-test-link { min-height:32px; }
    .preorder-dialog { width:min(var(--commerce-dialog-width,620px),calc(100% - 24px)); padding:0; border-radius:22px; }.preorder-dialog>.preorder-stage-heading { padding:22px 42px; }.preorder-dialog>[data-extra-close] { top:18px; right:18px; width:34px; height:34px; padding:8px; }
    .preorder-heading-row { gap:12px; }.preorder-heading-row .receipt-visual { width:52px; height:52px; flex-basis:52px; }.preorder-dialog .preorder-heading-row h2 { font-size:24px; }.preorder-stage-heading>p { font-size:13px; margin-top:12px; }
    .preorder-dialog>.account-action-content { padding:22px; }.preorder-dialog .order-product-cover { min-height:184px; margin-bottom:20px; }.preorder-dialog .preorder-money-row strong { font-size:30px; }
    .preorder-wallet-summary { padding:13px; gap:10px; }.preorder-wallet-icon { width:34px; height:36px; }.preorder-wallet-summary strong { font-size:17px; }.preorder-wallet-summary>div>span { font-size:11px; }
    .preorder-reserve-note { padding:13px; gap:10px; }.preorder-reserve-note span { font-size:12px; }.preorder-dialog .preorder-form-row { margin:18px 0; }.preorder-dialog .preorder-explanation { font-size:13px; }
    .preorder-demo-actions { padding:14px; border-radius:15px; }.preorder-demo-actions>p { font-size:12px; }.preorder-dialog .extra-support { margin-top:20px; }
  }
  @media(max-width:420px) { .preorder-heading-row { flex-direction:column; gap:10px; } }
  @media(min-width:540px) and (max-width:700px) { .account-page .account-tabs { grid-template-columns:repeat(6,minmax(0,1fr)); } }
  @media(prefers-reduced-motion:no-preference) { .account-action-dialog[open] { animation:account-extra-in .22s cubic-bezier(.22,1,.36,1); } @keyframes account-extra-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } } }
}
