/* AmeriGA minimal design system (v3) — self-contained, no framework */

.agm {
    --agm-bg: #fdfdfc;
    --agm-surface: #ffffff;
    --agm-ink: #16181d;
    --agm-muted: #5c6270;
    --agm-faint: #9aa0ad;
    --agm-line: #e4e5e8;
    --agm-line-strong: #16181d;
    --agm-radius: 10px;
    --agm-max: 1080px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--agm-ink);
    background: var(--agm-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body.agm-body { margin: 0; background: var(--agm-bg); }
.agm a { text-decoration: none; color: inherit; }
.agm *, .agm *::before, .agm *::after { box-sizing: border-box; }

/* Top bar */
.agm-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 28px;
    background: var(--agm-bg);
    z-index: 50;
}
.agm-sticky { position: sticky; top: 0; transition: box-shadow .2s ease, border-color .2s ease; border-bottom: 1px solid transparent; }
.agm-sticky.agm-scrolled { border-bottom-color: var(--agm-line); }
.agm-wordmark {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .22em;
    color: var(--agm-ink);
}
.agm-wordmark-sm { font-size: 13px; }
.agm-nav { display: flex; gap: 22px; }
.agm-nav a { font-size: 14px; color: var(--agm-muted); transition: color .15s ease; }
.agm-nav a:hover { color: var(--agm-ink); }

/* Tagline strip */
.agm-tagline {
    text-align: center;
    font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
    font-size: 12px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--agm-faint);
    padding: 44px 24px 34px;
}

/* Product grid */
.agm-grid-wrap { width: 100%; max-width: var(--agm-max); margin: 0 auto; padding: 0 28px; }
.agm-apps-head { margin: 8px 0 22px; }
.agm-apps-head .agm-kicker { margin-bottom: 8px; }
.agm-apps-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0 0 8px;
    color: var(--agm-ink);
}
.agm-apps-sub {
    font-size: 14.5px;
    color: var(--agm-muted);
    max-width: 560px;
    margin: 0;
}
.agm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0;
    overflow: hidden;
    border-top: 1px solid var(--agm-line-strong);
    border-left: 1px solid var(--agm-line-strong);
}
/* Product cards — "monochrome plate" language (v3.9): shared hairline lattice, no colour in the chrome */
.agm-tile {
    background: var(--agm-surface);
    border: 1px solid var(--agm-line-strong);
    margin: -1px 0 0 -1px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transition: opacity .5s ease, background .18s ease;
}
.agm-tile.agm-in { opacity: 1; }
.agm-tile:hover { background: #f7f7f4; }

/* Top row: reference number + status tag */
.agm-tile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
}
.agm-ref {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    letter-spacing: .1em;
    color: var(--agm-faint);
}
.agm-tag {
    display: inline-flex;
    align-items: center;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 3px 7px;
}
.agm-tag-live {
    background: var(--agm-ink);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}
.agm-tag-beta {
    border: 1px solid var(--agm-ink);
    color: var(--agm-ink);
    padding: 2px 6px;
}
.agm-tag-dev {
    border: 1px solid var(--agm-line);
    color: var(--agm-faint);
    padding: 2px 6px;
}

/* Identity block */
.agm-tile-id { padding: 8px 16px 4px; }
.agm-tile-name { font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.agm-tile-oneliner { font-size: 12.5px; color: var(--agm-muted); margin: 3px 0 0; }

/* Body: spec sheet */
.agm-tile-body { padding: 10px 16px 4px; flex: 1; }
.agm-spec { margin: 0; padding: 0; }
.agm-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding: 6px 0;
    border-top: 1px solid var(--agm-line);
}
.agm-spec-label {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--agm-faint);
    margin: 0;
    flex: none;
}
.agm-spec-value { font-size: 12.5px; color: var(--agm-ink); margin: 0; text-align: right; }
.agm-spec-value-full { text-align: left; }
.agm-tile-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--agm-muted);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Demo snippet helper classes (usable inside the per-product Demo HTML field) */
.agm-demo-bubble, .agm-demo-bubble-accent {
    border: 1px solid var(--agm-line);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    max-width: 92%;
    margin: 0 0 7px;
    background: var(--agm-surface);
}
.agm-demo-bubble-accent {
    border-color: transparent;
    background: #eef3fb;
    color: #1d4d85;
    margin-left: auto;
}
.agm-demo-caption {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--agm-faint);
    margin-top: 10px;
}
.agm-demo-highlight { background: #e1f5ee; color: #085041; padding: 1px 5px; border-radius: 3px; }

.agm-tile-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 12px 16px 14px;
    margin-top: 8px;
    border-top: 1px solid var(--agm-line-strong);
}
.agm-tile-foot-left {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}
.agm-tile-metric-wrap { min-height: 1px; }
.agm-tile-metric-wrap:empty { display: none; }

/* Custom per-product badges (bottom left) */
.agm-tile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.agm-cbadge {
    display: inline-flex;
    align-items: center;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 2px 6px;
    white-space: nowrap;
    color: var(--agm-cb, var(--agm-ink));
    border: 1px solid var(--agm-cb, var(--agm-ink));
    -webkit-text-fill-color: var(--agm-cb, var(--agm-ink));
}
.agm-tile-metric { font-size: 13px; color: var(--agm-ink); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.agm-tile-figure {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1;
    color: var(--agm-ink);
}
.agm-tile-figure-cap {
    display: block;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--agm-faint);
    margin-top: 5px;
}
.agm-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--agm-ink);
    border-bottom: 1.5px solid var(--agm-ink);
    padding-bottom: 2px;
    white-space: nowrap;
    transition: color .18s ease, border-color .18s ease;
}
.agm-open:hover {
    color: var(--agm-muted);
    border-color: var(--agm-muted);
}

/* Next slot */
.agm-next {
    margin-top: 16px;
    border: 1.5px dashed var(--agm-line);
    border-radius: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
}
.agm-next-left { display: flex; align-items: center; gap: 12px; }
.agm-next-num { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; color: var(--agm-faint); }
.agm-next-label { font-size: 14px; color: var(--agm-muted); }
.agm-next-cta { font-size: 13px; color: var(--agm-faint); transition: color .15s ease; }
.agm-next-cta:hover { color: var(--agm-ink); }

/* Custom band */
.agm-custom {
    margin-top: 56px;
    background: #f5f5f3;
    text-align: center;
    padding: 52px 24px;
}
.agm-kicker {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    letter-spacing: .16em;
    color: var(--agm-faint);
    margin-bottom: 10px;
}
.agm-custom-title { font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; }
.agm-custom-text { font-size: 14.5px; color: var(--agm-muted); max-width: 460px; margin: 0 auto 20px; }
.agm-btn {
    display: inline-block;
    border: 1px solid var(--agm-line-strong);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--agm-ink) !important;
    padding: 10px 20px;
    transition: background .15s ease, color .15s ease;
    cursor: pointer;
    background: transparent;
}
.agm-btn:hover { background: var(--agm-ink); color: #ffffff !important; }
.agm-btn-solid, .agm a.agm-btn-solid, .agm button.agm-btn-solid { background: var(--agm-ink); color: #ffffff !important; }
.agm-btn-solid:hover { background: #33363e; color: #ffffff !important; }

/* Mailing */
.agm-mailing { text-align: center; padding: 60px 24px 64px; }
.agm-mailing-title { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.agm-mailing-sub { font-size: 14px; color: var(--agm-muted); margin: 0 0 18px; }
.agm-mailing-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.agm-mailing-form input[type="email"] {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 14px;
    border: 1px solid var(--agm-line);
    border-radius: 6px;
    min-width: 260px;
    background: var(--agm-surface);
    color: var(--agm-ink);
}
.agm-mailing-form input[type="email"]:focus { outline: none; border-color: var(--agm-ink); }
.agm-mailing-msg { font-size: 13px; color: var(--agm-muted); margin-top: 12px; min-height: 18px; }
.agm-mailing-msg.agm-ok { color: #0f6e56; }
.agm-mailing-msg.agm-err { color: #a32d2d; }

/* Prompt tool hero */
.agm-tool { max-width: 620px; margin: 0 auto; padding: 6px 24px 34px; text-align: center; }
.agm-tool-heading {
    font-size: 27px;
    font-weight: 600;
    letter-spacing: -.015em;
    margin: 0 0 20px;
    color: var(--agm-ink) !important;
    font-family: inherit !important;
    text-transform: none !important;
    line-height: 1.3;
}

/* Integrated pill bar: gradient ring wrapper > white pill > icon + input + button */
.agm-bar-ring {
    position: relative;
    border-radius: 999px;
    padding: 1.5px;
    background: var(--agm-line);
    transition: background .25s ease;
}
.agm-bar-ring.agm-focus {
    background: linear-gradient(120deg, #378ADD, #7F77DD, #1D9E75, #378ADD);
    background-size: 300% 300%;
    animation: agm-ring 4s ease infinite;
}
@keyframes agm-ring {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.agm-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--agm-surface);
    border-radius: 999px;
    padding: 7px 7px 7px 20px;
    box-shadow: 0 6px 24px rgba(20, 22, 28, .07);
}
.agm-bar-icon { flex: none; width: 18px; height: 18px; color: var(--agm-faint); }
.agm-bar-ring.agm-focus .agm-bar-icon { color: #378ADD; }
.agm-bar input[type="text"] {
    flex: 1;
    font-family: inherit;
    font-size: 15.5px;
    padding: 10px 6px;
    border: 0 !important;
    background: transparent !important;
    color: var(--agm-ink) !important;
    box-shadow: none !important;
    min-width: 0;
}
.agm-bar input[type="text"]:focus { outline: none !important; }
.agm-bar .agm-btn { border-radius: 999px; padding: 11px 24px; flex: none; }
.agm-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.agm-chip {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--agm-muted) !important;
    background: transparent;
    border: 1px solid var(--agm-line);
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.agm-chip:hover { color: var(--agm-ink) !important; border-color: var(--agm-faint); transform: translateY(-1px); }

/* Generation progress */
.agm-gen { padding: 22px 6px 10px; text-align: center; }
.agm-gen-bar {
    height: 3px;
    border-radius: 3px;
    background: var(--agm-line);
    overflow: hidden;
    position: relative;
    max-width: 320px;
    margin: 0 auto 14px;
}
.agm-gen-bar::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 40%;
    border-radius: 3px;
    background: linear-gradient(90deg, #378ADD, #7F77DD, #1D9E75);
    animation: agm-sweep 1.1s ease-in-out infinite;
}
@keyframes agm-sweep {
    0% { left: -40%; }
    100% { left: 100%; }
}
.agm-gen-msg {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    letter-spacing: .06em;
    color: var(--agm-muted);
    min-height: 16px;
    transition: opacity .3s ease;
}

/* Blueprint document */
.agm-tool-result { text-align: left; margin-top: 20px; }
.agm-tool-result:empty { margin-top: 0; }
.agm-bp {
    position: relative;
    border: 1px solid var(--agm-line);
    border-radius: 12px;
    background:
        linear-gradient(var(--agm-surface), var(--agm-surface)) padding-box,
        repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(55, 138, 221, .05) 23px, rgba(55, 138, 221, .05) 24px),
        repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(55, 138, 221, .05) 23px, rgba(55, 138, 221, .05) 24px);
    background-color: var(--agm-surface);
    padding: 18px 22px 20px;
    overflow: hidden;
}
.agm-bp::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #378ADD, #7F77DD, #1D9E75);
}
.agm-bp-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--agm-faint);
    margin-bottom: 12px;
}
.agm-bp-row { opacity: 0; transform: translateY(8px); animation: agm-rise .45s ease forwards; }
@keyframes agm-rise {
    to { opacity: 1; transform: translateY(0); }
}
.agm-bp-title { font-size: 17px; font-weight: 600; margin: 0 0 10px; color: var(--agm-ink) !important; letter-spacing: -.01em; }
.agm-bp-pain {
    font-size: 13px;
    color: #8a4a1d;
    background: #faf3ec;
    border-left: 2px solid #d88b4a;
    border-radius: 0 6px 6px 0;
    padding: 9px 12px;
    margin: 0 0 12px;
}
.agm-bp-steps { position: relative; margin: 0 0 4px; padding-left: 2px; }
.agm-bp-step { display: flex; gap: 12px; font-size: 13.5px; color: var(--agm-muted); padding: 5px 0; position: relative; }
.agm-bp-step-num {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 10px;
    color: #378ADD;
    border: 1px solid rgba(55, 138, 221, .35);
    border-radius: 4px;
    padding: 2px 5px;
    height: fit-content;
    margin-top: 2px;
    flex: none;
    background: var(--agm-surface);
}
.agm-bp-impact {
    display: inline-block;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f6e56;
    background: #e6f5ef;
    border-radius: 6px;
    padding: 7px 12px;
    margin-top: 10px;
}
.agm-bp-rec { font-size: 13px; margin-top: 10px; color: var(--agm-muted); }
.agm-bp-rec a { font-weight: 500; border-bottom: 1px solid var(--agm-line-strong); color: var(--agm-ink) !important; }
.agm-bp-cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--agm-line); }
.agm-bp-cta-line { font-size: 13px; color: var(--agm-ink); flex: 1; min-width: 180px; }
.agm-bp-cta-btn { font-size: 13px; padding: 10px 20px; border-radius: 999px; }
.agm-bp-more { font-size: 12px; color: var(--agm-muted) !important; margin-top: 12px; display: inline-block; border-bottom: 1px solid var(--agm-line); }
.agm-bp-loading { font-size: 12px; color: var(--agm-faint); padding: 6px 0; }
.agm-bp-error { font-size: 13px; color: #a32d2d; padding: 6px 0; }
.agm-tool-footnote { font-size: 12px; color: var(--agm-faint); margin-top: 14px; }
@media (max-width: 560px) {
    .agm-tool-heading { font-size: 21px; }
    .agm-bar { padding-left: 14px; }
    .agm-bar .agm-btn { padding: 10px 16px; font-size: 13px; }
}

/* Footer */
.agm-footer {
    margin-top: auto;
    border-top: 1px solid var(--agm-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 20px 28px;
}
.agm-footer-brand { display: flex; align-items: baseline; gap: 14px; }
.agm-footer-tagline { font-size: 12.5px; color: var(--agm-faint); }
.agm-footer-meta { display: flex; gap: 18px; font-size: 12.5px; color: var(--agm-muted); flex-wrap: wrap; }
.agm-footer-meta a { color: var(--agm-muted); border-bottom: 1px solid var(--agm-line); }
.agm-footer-meta a:hover { color: var(--agm-ink); }

/* Responsive */
@media (max-width: 640px) {
    .agm-topbar { padding: 14px 18px; }
    .agm-grid-wrap { padding: 0 18px; }
    .agm-tagline { padding: 30px 18px 24px; }
    .agm-custom-title { font-size: 20px; }
    .agm-apps-title { font-size: 20px; }
}
