:root { color-scheme: light; --ap-ink: #18243b; --ap-muted: #526079; --ap-accent: #4338ca; --ap-line: #dce2ee; --ap-bg: #f6f7fb; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ap-ink); }
body.ap-page { background: var(--ap-bg); font: 16px/1.7 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; padding: 0 24px; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #4f46e5; outline-offset: 3px; }
.ap-skip { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px; background: white; color: var(--ap-accent); }
.ap-skip:focus { top: 12px; }
.ap-header { max-width: 1120px; margin: 0 auto 32px; border-bottom: 1px solid var(--ap-line); }
.ap-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 80px; flex-wrap: wrap; padding: 16px 0; }
.ap-brand { font-size: 21px; font-weight: 800; letter-spacing: -.6px; color: var(--ap-accent); text-decoration: none; }
.ap-nav-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.ap-nav-links a, .ap-footer a { color: var(--ap-muted); text-decoration: none; }
.ap-nav-links a:hover, .ap-footer a:hover { text-decoration: underline; color: var(--ap-accent); }
.ap-tools-menu { position: relative; }
.ap-tools-menu summary { cursor: pointer; color: var(--ap-ink); padding: 6px 0; }
.ap-tools-menu[open] > div { position: absolute; z-index: 20; top: 100%; left: 0; display: grid; width: 240px; padding: 12px; border: 1px solid var(--ap-line); border-radius: 12px; background: white; box-shadow: 0 14px 36px #18243b1a; }
.ap-tools-menu a { padding: 9px 12px; border-radius: 6px; }
.ap-tools-menu a:hover { background: #eef2ff; }
.ap-main { max-width: 1120px; margin: auto; }
.ap-hero { max-width: 800px; margin: 0 0 32px; }
.ap-eyebrow { margin: 0 0 8px; color: var(--ap-accent); font-weight: 700; font-size: 13px; letter-spacing: .06em; }
.ap-hero h1 { font-size: clamp(28px, 4.3vw, 44px); font-weight: 800; line-height: 1.2; letter-spacing: -.03em; margin: 0 0 16px; }
.ap-lead { color: var(--ap-muted); font-size: 18px; max-width: 740px; }
.ap-workbench { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 36px; }
.ap-panel { min-width: 0; background: white; border: 1px solid var(--ap-line); border-radius: 16px; padding: 28px; }
.ap-panel h2 { margin: 0 0 20px; font-size: 20px; font-weight: 750; }
.ap-field { display: grid; gap: 6px; margin: 0 0 18px; }
.ap-field label, .ap-label { font-size: 14px; font-weight: 650; }
.ap-field input:not([type=color]), .ap-field select, .ap-output { width: 100%; min-width: 0; border: 1px solid #9ba8bf; border-radius: 8px; padding: 10px 12px; background: white; color: var(--ap-ink); box-sizing: border-box; }
.ap-field input[type=color] { height: 42px; width: 100%; padding: 3px; border: 1px solid #9ba8bf; border-radius: 8px; background: white; }
.ap-field input:disabled, .ap-field select:disabled { opacity: .5; }
.ap-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-color-input { display: flex; align-items: center; gap: 8px; }
.ap-color-input input[type=color] { flex: 0 0 44px; width: 44px; height: 40px; padding: 3px; border: 1px solid #9ba8bf; border-radius: 8px; background: white; }
.ap-color-input input[type=text] { min-width: 0; }
.ap-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--ap-accent); border-radius: 8px; padding: 11px 18px; font-weight: 650; font-size: 14px; line-height: 1.4; color: white; background: var(--ap-accent); cursor: pointer; text-decoration: none; }
.ap-button:hover { background: #312e81; color: white; }
.ap-button-secondary { background: white; color: var(--ap-accent); }
.ap-button-secondary:hover { background: #eef2ff; color: #312e81; }
.ap-button[aria-disabled=true], .ap-button:disabled { opacity: .45; cursor: not-allowed; }
.ap-actions, .ap-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.ap-presets button { border: 1px solid #c7d2fe; border-radius: 24px; padding: 5px 12px; background: #eef2ff; color: #3730a3; font-size: 13px; cursor: pointer; }
.ap-note { font-size: 13px; color: var(--ap-muted); margin: 12px 0; }
.ap-status { font-size: 14px; min-height: 24px; color: var(--ap-muted); }
.ap-file-result { padding: 30px 16px; text-align: center; border: 1px dashed #a5b4fc; border-radius: 12px; background: #f8faff; min-height: 180px; }
.ap-file-icon { font-size: 44px; color: var(--ap-accent); font-weight: 750; line-height: 1.3; margin-bottom: 14px; }
.ap-file-result audio { width: 100%; margin: 16px 0; }
.ap-output { display: block; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; resize: vertical; overflow-wrap: anywhere; background: #f8faff; }
.ap-preview { width: 100%; max-height: 340px; object-fit: contain; border: 1px solid var(--ap-line); border-radius: 10px; background: #f5f5f5; margin-bottom: 16px; }
.ap-prose { max-width: 840px; color: #334155; }
.ap-prose h2 { color: var(--ap-ink); font-size: 25px; font-weight: 750; margin: 36px 0 12px; line-height: 1.35; }
.ap-prose h3 { color: var(--ap-ink); font-size: 19px; font-weight: 700; margin: 24px 0 8px; }
.ap-prose p { margin: 12px 0; }
.ap-prose a, .ap-inline-link { color: var(--ap-accent); text-decoration: underline; text-underline-offset: 3px; }
.ap-prose ul, .ap-prose ol { padding-left: 24px; margin: 16px 0; }
.ap-prose ul { list-style: disc; } .ap-prose ol { list-style: decimal; }
.ap-prose li { margin: 8px 0; }
.ap-prose pre { overflow-x: auto; background: #eef2ff; border-radius: 10px; padding: 18px; font: 13px/1.6 ui-monospace, monospace; }
.ap-table-wrap { overflow-x: auto; }
.ap-api-table table { min-width: 540px; }
.ap-prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.ap-prose th, .ap-prose td { border-bottom: 1px solid var(--ap-line); text-align: left; padding: 12px 10px; vertical-align: top; }
.ap-prose th { background: #eef2ff; color: var(--ap-ink); }
.ap-callout { padding: 18px 22px; border-left: 3px solid #6366f1; background: #eef2ff; border-radius: 0 10px 10px 0; margin: 24px 0; }
.ap-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.ap-card { display: block; border: 1px solid var(--ap-line); background: white; border-radius: 12px; padding: 24px; text-decoration: none; color: var(--ap-ink); }
.ap-card:hover { border-color: #818cf8; }
.ap-card h2, .ap-card h3 { font-size: 19px; font-weight: 750; margin: 0 0 10px; }
.ap-card p { font-size: 14px; color: var(--ap-muted); margin: 0; }
.ap-support { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--ap-line); padding: 28px 0; margin-top: 48px; }
.ap-support h2 { font-size: 18px; font-weight: 700; margin: 0 0 5px; }
.ap-support p { margin: 0; max-width: 620px; color: var(--ap-muted); font-size: 14px; }
.ap-support-link { display: inline-flex; background: #fef3c7; color: #78350f; padding: 11px 18px; border: 1px solid #fcd34d; border-radius: 8px; text-decoration: none; font-size: 14px; font-weight: 700; }
.ap-support-link:hover { background: #fde68a; }
.ap-support-inline { margin: 12px 0; font-size: 13px; color: var(--ap-muted); }
.ap-support-inline a { color: var(--ap-accent); text-decoration: underline; text-underline-offset: 3px; }
.ap-footer { max-width: 1120px; margin: 40px auto 0; padding: 24px 0 32px; border-top: 1px solid var(--ap-line); color: var(--ap-muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.ap-footer div { display: flex; flex-wrap: wrap; gap: 16px; }
.ap-related { border-top: 1px solid var(--ap-line); margin-top: 36px; padding-top: 20px; }
.ap-tool-shortcuts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.ap-tool-shortcuts a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1px solid #c7d2fe; border-radius: 24px; background: white; color: var(--ap-accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.ap-tool-shortcuts a:hover { background: #eef2ff; border-color: #818cf8; }
@media (max-width: 760px) {
  body.ap-page { padding: 0 16px; }
  .ap-nav { gap: 10px; }
  .ap-nav-links { gap: 14px; font-size: 13px; }
  .ap-workbench { grid-template-columns: 1fr; }
  .ap-panel { padding: 20px; }
  .ap-card-grid { grid-template-columns: 1fr; }
  .ap-tools-menu[open] > div { left: 0; max-width: calc(100vw - 50px); }
  body.bg-gray-100 { padding: 16px; }
  body.bg-gray-100 > .max-w-4xl { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
