.page-grid.af-page { display: block; }
.af-main { --af-ink: var(--text); --af-muted: var(--muted); --af-outline: var(--line); --af-soft: var(--panel); --af-paper: var(--bg); --af-accent: var(--reading-accent, #406b58); width: 100%; min-width: 0; padding-bottom: 32px; }
.af-main button { font: inherit; cursor: pointer; }
.af-main [hidden] { display: none !important; }
.af-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.af-categories { display: flex; align-items: center; gap: 30px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.af-categories::-webkit-scrollbar { display: none; width: 0; height: 0; }
.af-categories button { position: relative; display: inline-flex; flex: none; align-items: center; gap: 9px; padding: 0 0 14px; border: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: 14px; line-height: 1.5; white-space: nowrap; transition: color .16s; }
.af-categories button:hover { color: var(--text); }
.af-categories button[aria-pressed="true"] { color: var(--text); font-weight: 600; }
.af-categories button[aria-pressed="true"]::after { content: ""; position: absolute; height: 2px; inset: auto 0 0; background: var(--reading-accent, var(--mint)); }
.af-category-count { font-size: 10px; opacity: .65; font-variant-numeric: tabular-nums; }
.af-search { display: flex; align-items: center; gap: 9px; flex: 0 1 265px; min-width: 180px; min-height: 40px; margin-bottom: 12px; padding: 5px 11px; border: 1px solid var(--af-outline); border-radius: 8px; background: var(--af-paper); transition: border-color .16s, box-shadow .16s; }
.af-search:focus-within { border-color: var(--af-accent); box-shadow: 0 0 0 3px var(--af-soft); }
.af-search svg { flex-shrink: 0; color: var(--af-muted); }
.af-search input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 3px 0; color: var(--af-ink); background: transparent; font: inherit; font-size: 12px; }
.af-search input::placeholder { color: var(--af-muted); }
.af-search kbd { white-space: nowrap; font: inherit; font-size: 10px; color: var(--af-muted); opacity: .7; }
.af-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; }
.af-card { display: flex; flex-direction: column; min-width: 0; padding: 22px 22px 0; border: 1px solid var(--af-outline); border-radius: 16px; background: var(--af-paper); position: relative; transition: border-color .2s, box-shadow .2s, transform .2s; animation: af-appear .3s ease-out both; animation-delay: calc(var(--af-order,0) * 25ms); }
.af-card:hover { border-color: color-mix(in srgb,var(--af-accent) 35%,var(--af-outline)); box-shadow: 0 12px 32px #173b2b09; transform: translateY(-3px); }
.af-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.af-card-heading > div { min-width: 0; flex: 1; }
.af-card-agent { display: block; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; color: var(--af-ink); line-height: 1.5; }
.af-card-kind { display: block; color: var(--af-muted); font-size: 10px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-maker-badge { flex-shrink: 0; color: var(--af-muted); font-size: 9px; background: var(--af-soft); border-radius: 4px; padding: 4px 6px; white-space: nowrap; }
.af-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #e9ece8; border-radius: 11px; background: #fff; overflow: hidden; }
.af-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.af-card h3 { margin: 21px 0 0; min-height: 54px; }
.af-card h3 button { display: block; width: 100%; text-align: left; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 18px; line-height: 1.5; font-weight: 650; letter-spacing: -.025em; }
.af-card h3 button:hover { color: var(--af-accent); }
.af-card-summary { margin: 14px 0; color: var(--af-ink); font-size: 13px; line-height: 1.85; overflow-wrap: anywhere; }
.af-card-label { display: block; margin-bottom: 4px; color: var(--af-muted); font-size: 11px; font-weight: 500; }
.af-card-access { margin-bottom: 18px; font-size: 12px; line-height: 1.7; color: var(--af-ink); }
.af-case-result { margin-top: auto; padding: 15px 17px; border-radius: 9px; background: var(--af-soft); }
.af-result-caption { display: block; color: var(--af-muted); font-size: 10px; letter-spacing: .03em; }
.af-case-result strong { display: block; color: var(--af-accent); font-size: 18px; font-weight: 600; line-height: 1.55; letter-spacing: -.025em; margin: 8px 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.af-result-value { display: inline-block; max-width: 100%; vertical-align: baseline; }
.af-case-result > span:not(.af-result-caption) { display: block; font-size: 11px; line-height: 1.6; color: var(--af-ink); }
.af-case-result small { display: block; color: var(--af-muted); font-size: 10px; line-height: 1.7; margin-top: 3px; }
.af-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; padding: 12px 0; }
.af-case-source { color: var(--af-muted); font-size: 10px; max-width: 64%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-card-actions button { display: flex; align-items: center; gap: 9px; padding: 6px 0 6px 12px; border: 0; background: transparent; color: var(--af-ink); font-size: 11px; min-height: 34px; }
.af-action-plus { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--af-outline); border-radius: 50%; font-size: 16px; line-height: 1; transition: background .18s, color .18s; }
.af-card-actions button:hover .af-action-plus { background: var(--af-accent); color: var(--af-paper); border-color: transparent; }
.af-catalog-note { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 28px; color: var(--af-muted); font-size: 10px; line-height: 1.8; }
.af-catalog-note details { max-width: 430px; text-align: right; }
.af-catalog-note summary { cursor: pointer; }
.af-discovery-status { margin-top: 10px; }
.af-discovery-status span { display: block; }
.af-catalog-note p { margin: 8px 0 0; }
.af-secondary { color: var(--af-ink); background: var(--af-paper); border: 1px solid var(--af-outline); border-radius: 8px; padding: 10px 16px; font-size: 12px !important; }
.af-empty { text-align: center; padding: 65px 20px; }
.af-empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 20px; color: var(--af-accent); background: var(--af-soft); border-radius: 50%; font-size: 22px; }
.af-empty h3 { font-size: 18px; margin: 0 0 8px; }
.af-empty p { color: var(--af-muted); margin-bottom: 24px; font-size: 13px; }
.af-detail { position: fixed; inset: 0; width: min(820px,calc(100vw - 48px)); max-width: 820px; max-height: min(820px,calc(100dvh - 64px)); margin: auto; padding: 0; border: 1px solid var(--af-outline); border-radius: 20px; background: var(--af-paper); color: var(--text); overflow: hidden; box-shadow: 0 32px 100px #071b2a26; }
.af-detail::backdrop { background: #17271e66; backdrop-filter: blur(7px); }
.af-detail[open] { animation: af-detail-in .2s ease-out; }
.af-detail [data-detail-content] { display: flex; flex-direction: column; max-height: min(818px,calc(100dvh - 66px)); }
.af-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 30px 20px; flex-shrink: 0; }
.af-detail-header .af-card-heading { flex: 1; }
.af-detail-header .af-mark { width: 46px; height: 46px; flex-basis: 46px; }
.af-detail-header h2 { color: var(--af-ink); font-size: 17px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.af-detail-header p { margin: 4px 0 0; color: var(--af-muted); font-size: 11px; line-height: 1.5; }
.af-close { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; color: var(--af-muted); background: var(--af-soft); border: 0; border-radius: 50%; transition: background .16s; }
.af-close:hover { background: var(--af-outline); }
.af-detail-tabs { display: flex; gap: 27px; padding: 0 30px; border-bottom: 1px solid var(--af-outline); flex-shrink: 0; }
.af-detail-tabs button { position: relative; padding: 12px 0 15px; border: 0; background: transparent; color: var(--af-muted); font-size: 12px; }
.af-detail-tabs button[aria-selected="true"] { color: var(--af-accent); font-weight: 600; }
.af-detail-tabs button[aria-selected="true"]::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: var(--af-accent); }
.af-detail-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--af-outline) transparent; }
.af-detail-body { padding: 28px 30px; animation: af-appear .18s ease-out; overflow-wrap: anywhere; }
.af-example-label { color: var(--af-muted); font-size: 10px; }
.af-detail .af-task-title { color: var(--text); font-size: 25px; font-weight: 650; letter-spacing: -.03em; margin: 9px 0 11px; line-height: 1.5; }
.af-output { color: var(--af-ink); line-height: 1.85; margin: 0; font-size: 14px; }
.af-start { margin-top: 24px; padding: 20px; border: 1px solid var(--af-outline); border-radius: 12px; background: var(--af-soft); }
.af-start p { font-size: 13px; line-height: 1.85; color: var(--af-muted); margin: 12px 0; }
.af-start .af-first-step { color: var(--af-ink); }
.af-detail-body .af-start h3 { font-size: 15px; }
.af-access-badge { font-size: 12px; color: var(--af-ink); }
.af-start-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; }
.af-entry-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border: 1px solid var(--af-outline); border-radius: 7px; background: var(--af-paper); color: var(--af-accent); font-size: 13px; line-height: 1.6; }
.af-start-actions button { padding: 8px 0; min-height: 42px; border: 0; background: transparent; color: var(--af-ink); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.af-guide-start { margin: 0 0 28px; }
.af-detail-result { margin-top: 24px; padding: 21px 24px; border-radius: 12px; background: var(--af-soft); }
.af-detail-result strong { display: block; font-size: 24px; color: var(--af-accent); font-weight: 600; letter-spacing: -.025em; line-height: 1.5; margin: 7px 0; }
.af-detail-result > span:not(.af-result-caption) { font-size: 12px; color: var(--af-ink); }
.af-detail-result p { color: var(--af-muted); font-size: 12px; line-height: 1.85; margin: 10px 0 0; }
.af-detail-context { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-top: 27px; }
.af-detail-body h3 { font-size: 12px; margin: 0 0 12px; color: var(--af-ink); }
.af-detail-context ul { padding-left: 16px; margin: 0; color: var(--af-muted); font-size: 12px; line-height: 1.85; }
.af-detail-context li + li { margin-top: 7px; }
.af-source-panel { border-left: 1px solid var(--af-outline); padding-left: 26px; }
.af-source-panel a { color: var(--af-accent); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.af-source-panel p { font-size: 12px; color: var(--af-muted); line-height: 1.7; margin: 8px 0; }
.af-source-panel > span { font-size: 10px; color: var(--af-muted); }
.af-detail-note { margin: 23px 0 0; padding-top: 16px; border-top: 1px solid var(--af-outline); color: var(--af-muted); font-size: 11px; line-height: 1.8; }
.af-steps { display: grid; grid-template-columns: 1fr; gap: 18px; list-style: none; margin: 0; padding: 0; }
.af-steps li > span { display: block; color: var(--af-accent); font-size: 12px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--af-outline); padding-top: 12px; }
.af-steps p { color: var(--af-ink); font-size: 13px; line-height: 1.85; margin: 8px 0 0; }
.af-prompt-section { margin-top: 28px; }
.af-prompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.af-prompt-heading h3 { margin: 0 0 6px; }
.af-prompt-origin { color: var(--af-muted); font-size: 10px; line-height: 1.7; }
.af-copy-button { border: 0; border-radius: 7px; padding: 9px 13px; color: var(--af-paper); background: var(--af-ink); font-size: 11px !important; white-space: nowrap; }
.af-copy-button:hover { background: var(--af-accent); }
.af-prompt { margin: 0; padding: 22px; color: var(--af-ink); background: var(--af-soft); border: 1px solid var(--af-outline); border-radius: 10px; font-size: 13px; line-height: 2; user-select: text; white-space: pre-wrap; }
.af-copy-status { color: var(--af-accent); min-height: 20px; font-size: 11px; line-height: 1.8; margin: 8px 0 0; }
.af-detail-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; padding: 16px 30px; border-top: 1px solid var(--af-outline); color: var(--af-muted); font-size: 10px; }
.af-detail-footer a { color: var(--af-accent); font-size: 11px; text-decoration: none; }
.af-detail-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.af-dialog-open { overflow: hidden; }
.af-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.af-main :is(button,a,input,.af-prompt,.af-detail-scroll,summary):focus-visible { outline: 2px solid var(--af-accent); outline-offset: 4px; }
.af-search input:focus-visible { outline: none; }
@keyframes af-appear { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes af-detail-in { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
@media(min-width:1750px) { .af-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media(max-width:1300px) { .af-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .af-toolbar { flex-wrap: wrap; gap: 15px; } .af-search { flex-grow: 1; max-width: 320px; } }
@media(max-width:780px) {
  .af-toolbar { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 14px; margin-bottom: 18px; }
  .af-search { flex: none; width: 100%; max-width: none; min-height: 43px; margin-bottom: 0; }
  .af-search input { font-size: 16px; }
  .af-search kbd { display: none; }
  .af-categories { width: 100%; margin-right: 0; gap: 20px; }
  .af-categories button { padding: 8px 0 13px; min-height: 42px; font-size: 12px; }
  .af-grid { gap: 15px; }
  .af-card { padding: 21px 20px 0; }
  .af-card-actions button { min-height: 42px; }
  .af-catalog-note { flex-direction: column; gap: 12px; }
  .af-catalog-note details { text-align: left; }
  .af-detail { width: calc(100vw - 24px); max-height: calc(100dvh - 28px); border-radius: 16px; }
  .af-detail [data-detail-content] { max-height: calc(100dvh - 30px); }
  .af-detail-header { padding: 20px 20px 14px; gap: 12px; }
  .af-detail-header h2 { font-size: 15px; }
  .af-detail-header .af-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .af-close { width: 40px; height: 40px; }
  .af-detail-tabs { padding-inline: 20px; }
  .af-detail-tabs button { min-height: 44px; }
  .af-detail-body { padding: 22px 20px; }
  .af-detail .af-task-title { font-size: 21px; }
  .af-detail-result { padding: 18px; }
  .af-detail-result strong { font-size: 21px; }
  .af-detail-context { grid-template-columns: 1fr; gap: 20px; }
  .af-source-panel { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--af-outline); }
  .af-steps { grid-template-columns: 1fr; gap: 14px; }
  .af-steps li { display: flex; align-items: baseline; gap: 15px; }
  .af-steps li > span { border-top: 0; padding-top: 0; }
  .af-steps p { margin: 0; }
  .af-prompt-heading { align-items: flex-start; }
  .af-prompt { padding: 17px; font-size: 12px; }
  .af-detail-footer { padding: 15px 20px; }
}
@media(max-width:560px) { .af-grid { grid-template-columns: minmax(0,1fr); } }
@media(prefers-reduced-motion:reduce) { .af-main *, .af-detail[open] { animation: none; transition: none; } }
