/* ── Tool Page Layout ───────────────────────────────────────────── */
.tool-hero {
    background: linear-gradient(145deg, #0a2420 0%, #0e2d27 40%, #133829 70%, #0e3530 100%);
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.tool-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(78,179,154,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78,179,154,.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.tool-hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 700px; height: 400px;
    background: radial-gradient(ellipse, rgba(78,179,154,.12) 0%, transparent 68%);
    pointer-events: none;
}
.tool-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
}
.tool-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    font-weight: 500;
    color: rgba(111,209,179,.65);
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tool-eyebrow::before { content: '//'; opacity: .45; }
.eyebrow-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #6fd1b3;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.5; transform:scale(.8); }
}
.tool-hero h1 {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.025em;
    margin-bottom: .9rem;
}
.tool-hero h1 em { font-style: normal; color: #6fd1b3; }
.tool-hero-desc {
    font-size: 1rem;
    color: rgba(255,255,255,.55);
    line-height: 1.8;
    max-width: 620px;
    margin-bottom: 1.5rem;
}
.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 0;
}
.hero-pill {
    font-family: 'DM Mono', monospace;
    font-size: .68rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(78,179,154,.3);
    color: rgba(111,209,179,.75);
    background: rgba(78,179,154,.06);
}

/* ── Main content area ───────────────────────────────────────────── */
.tool-body {
    padding: 2.5rem 0 3.5rem;
}

/* ── Upload zone ─────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed rgba(78,179,154,.35);
    border-radius: 12px;
    background: #fff;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    margin-bottom: 1.25rem;
    position: relative;
}
.upload-zone.drag-over {
    border-color: #4eb39a;
    background: #e8f7f2;
}
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    color: var(--brand);
}
.upload-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: .3rem; }
.upload-zone p  { font-size: .85rem; color: var(--text-muted); }
.upload-zone .or-divider {
    display: flex; align-items: center; gap: .75rem;
    margin: 1.2rem 0;
    color: var(--text-muted);
    font-size: .8rem;
}
.upload-zone .or-divider::before,
.upload-zone .or-divider::after {
    content: ''; flex: 1;
    height: 1px; background: var(--border);
}

/* ── Textarea ─────────────────────────────────────────────────────── */
.json-input-wrap { position: relative; }
.json-input-wrap label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .5rem;
}
#jsonInput {
    width: 100%;
    min-height: 220px;
    font-family: 'DM Mono', monospace;
    font-size: .78rem;
    line-height: 1.6;
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--text);
    resize: vertical;
    transition: border-color .2s;
    outline: none;
}
#jsonInput:focus { border-color: var(--brand); }
.char-count {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: .35rem;
}

/* ── Action bar ──────────────────────────────────────────────────── */
.action-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}
.btn-primary {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--brand);
    color: #0e2d27;
    padding: 12px 26px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .18s;
    text-decoration: none;
}
.btn-primary:hover { background: #6fd1b3; transform: translateY(-2px); }
.btn-primary svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.btn-secondary {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff;
    color: var(--text);
    padding: 11px 22px;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--accent-light); }
.btn-secondary svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-danger {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    color: #c0392b;
    padding: 11px 18px;
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 600;
    border: 1.5px solid rgba(192,57,43,.25);
    cursor: pointer;
    transition: all .18s;
}
.btn-danger:hover { background: #fdf0ee; border-color: #c0392b; }
.btn-danger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Results ─────────────────────────────────────────────────────── */
#resultsSection { display: none; margin-top: 2.5rem; }

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}
.result-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex; align-items: center; gap: .5rem;
}
.result-title svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.result-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Stats row */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.stat-chip {
    display: flex; align-items: center; gap: .45rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}
.stat-chip-num {
    font-family: 'DM Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand);
}
.stat-chip-label { color: var(--text-muted); font-weight: 500; }

/* Tabs */
.result-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.25rem;
}
.tab-btn {
    padding: 10px 20px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex; align-items: center; gap: 6px;
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab-badge {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    background: var(--accent-light);
    color: var(--brand);
    border-radius: 20px;
    padding: 1px 7px;
    font-weight: 600;
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Output textarea */
.output-wrap { position: relative; }
#paramOutput {
    width: 100%;
    min-height: 320px;
    font-family: 'DM Mono', monospace;
    font-size: .76rem;
    line-height: 1.65;
    padding: 1rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #0d1f1c;
    color: #6fd1b3;
    resize: vertical;
    outline: none;
}

/* Mapping table */
.mapping-table-wrap {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}
.mapping-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}
.mapping-table-wrap thead th {
    background: var(--accent-light);
    color: var(--brand-dark);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1.5px solid var(--border);
}
.mapping-table-wrap tbody tr { transition: background .12s; }
.mapping-table-wrap tbody tr:hover { background: #f5f9f8; }
.mapping-table-wrap tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(78,179,154,.1);
    vertical-align: middle;
    word-break: break-all;
}
.mapping-table-wrap tbody tr:last-child td { border-bottom: none; }
.td-placeholder {
    font-family: 'DM Mono', monospace;
    font-size: .78rem;
    color: var(--brand-dark);
    font-weight: 600;
}
.td-arn {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    color: var(--text-muted);
}
.td-type {
    white-space: nowrap;
}
.type-badge {
    font-family: 'DM Mono', monospace;
    font-size: .63rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.tb-queue    { background: #e1f0ff; color: #1a5ca8; }
.tb-lambda   { background: #fff3e1; color: #a85f1a; }
.tb-lex      { background: #f3e1ff; color: #7a1aa8; }
.tb-prompt   { background: #e1fff3; color: #1aa87a; }
.tb-flow     { background: #ffe1e1; color: #a81a1a; }
.tb-hours    { background: #e8e1ff; color: #4a1aa8; }
.tb-phone    { background: #fffae1; color: #a8941a; }
.tb-security { background: #e1f0ff; color: #1a4d8f; }
.tb-generic  { background: #f0f0f0; color: #555; }

/* Warning banner (multi-instance / sanity-check notices) */
.warning-banner {
    display: none;
    background: #fff8e1;
    border: 1.5px solid rgba(168,148,26,.4);
    border-radius: var(--radius);
    padding: .85rem 1.25rem;
    margin-bottom: 1.5rem;
    color: #7a611a;
    font-size: .88rem;
    font-weight: 500;
    align-items: flex-start;
    gap: .6rem;
}
.warning-banner svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; margin-top: 1px; }
.warning-banner.visible { display: flex; }

/* Last-updated line */
.last-updated-note {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    color: var(--text-muted);
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.last-updated-note svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.last-updated-note--hero {
    color: rgba(111,209,179,.8);
    background: rgba(78,179,154,.08);
    border: 1px solid rgba(78,179,154,.25);
    border-radius: 10px;
    padding: 7px 14px;
    margin: 0 0 1.1rem;
    max-width: 620px;
    line-height: 1.55;
    align-items: flex-start;
}
.last-updated-note--hero svg { color: #6fd1b3; margin-top: 2px; }

/* Sample loader buttons */
.sample-row { margin-top: .65rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.sample-row-label { font-size: .78rem; font-weight: 600; color: var(--text-muted); }
.sample-btn {
    font-family: 'DM Mono', monospace;
    font-size: .72rem;
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--accent-light);
    border: 1px solid rgba(78,179,154,.3);
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    transition: all .15s;
}
.sample-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Tool card wrapper ───────────────────────────────────────────── */
.tool-card {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 16px;
    padding: 2rem 2rem 2.25rem;
    box-shadow: 0 1px 2px rgba(16,40,34,.04), 0 10px 28px rgba(16,40,34,.05);
}
.tool-card + .tool-card { margin-top: 2rem; }
@media (max-width: 640px) {
    .tool-card { padding: 1.25rem 1.1rem 1.5rem; border-radius: 12px; }
}

/* Re-hydrate section */
.rehydrate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
@media (max-width: 800px) { .rehydrate-grid { grid-template-columns: 1fr; } }
.rehydrate-grid textarea {
    width: 100%; min-height: 180px;
    font-family: 'DM Mono', monospace; font-size: .76rem; line-height: 1.6;
    padding: 1rem 1.1rem; border: 1.5px solid var(--border); border-radius: var(--radius);
    background: #fff; color: var(--text); resize: vertical; outline: none;
}
.rehydrate-grid textarea:focus { border-color: var(--brand); }
.rehydrate-grid label { display:block; font-size:.85rem; font-weight:600; color: var(--text); margin-bottom:.5rem; }
#rehydrateUnmapped { font-size: .8rem; color: var(--text-muted); margin-top: .6rem; }

/* Error box */
.error-box {
    display: none;
    background: #fdf0ee;
    border: 1.5px solid rgba(192,57,43,.3);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    color: #7b2d22;
    font-size: .88rem;
    align-items: flex-start;
    gap: .75rem;
}
.error-box svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
.error-box.visible { display: flex; }

/* Success badge */
.success-banner {
    display: none;
    background: #e8f7f2;
    border: 1.5px solid rgba(78,179,154,.4);
    border-radius: var(--radius);
    padding: .85rem 1.25rem;
    margin-bottom: 1.5rem;
    color: #1a4d3a;
    font-size: .88rem;
    font-weight: 500;
    align-items: center;
    gap: .6rem;
}
.success-banner svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; color: var(--brand); }
.success-banner.visible { display: flex; }

/* Loading spinner */
.spinner-wrap {
    display: none;
    align-items: center;
    gap: .5rem;
    color: var(--text-muted);
    font-size: .85rem;
}
.spinner-wrap.visible { display: flex; }
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Info section ────────────────────────────────────────────────── */
.info-section {
    padding: 3rem 0 3.5rem;
    background: #fff;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.info-card {
    background: #f5f9f8;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
}
.info-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--accent-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand);
    margin-bottom: 1rem;
}
.info-card-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.info-card h3 { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; }
.info-card p  { font-size: .85rem; color: var(--text-muted); line-height: 1.65; }

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq-section { padding: 3rem 0 3.5rem; }
.faq-list { margin-top: 2rem; display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}
.faq-q {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    text-align: left;
    gap: .75rem;
}
.faq-chevron { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; transition: transform .25s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-a {
    display: none;
    padding: 0 1.5rem 1.1rem;
    font-size: .88rem;
    color: var(--text-muted);
    line-height: 1.75;
}
.faq-item.open .faq-a { display: block; }

/* ── Section heading helper ──────────────────────────────────────── */
.section-eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: .65rem;
    font-weight: 500;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--brand);
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: .65rem;
}
.ey-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); display: inline-block; }
.section-heading { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; color: var(--text); letter-spacing: -.02em; margin-bottom: .5rem; }
.section-sub { font-size: .95rem; color: var(--text-muted); line-height: 1.7; max-width: 600px; }

/* ── step list ───────────────────────────────────────────────────── */
.steps-list { counter-reset: steps; display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.step-item {
    counter-increment: steps;
    display: flex; align-items: flex-start; gap: 1rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 1.1rem 1.4rem;
}
.step-num {
    font-family: 'DM Mono', monospace;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.step-num::before { content: counter(steps); }
.step-text h4 { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.step-text p  { font-size: .84rem; color: var(--text-muted); line-height: 1.65; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .action-bar { flex-direction: column; }
    .action-bar .btn-primary,
    .action-bar .btn-secondary,
    .action-bar .btn-danger { width: 100%; justify-content: center; }
    .result-actions { width: 100%; }
    .result-actions .btn-secondary { flex: 1; justify-content: center; }
    .result-header { flex-direction: column; align-items: flex-start; }
    .stats-row { flex-direction: column; }
    .stat-chip { width: 100%; }
}
