.app-gate {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: clamp(18px, 2.2vw, 26px);
    border: 1px solid var(--app-border-soft, rgba(255, 255, 255, 0.08));
    border-radius: var(--app-radius-section, 12px);
    background: var(--app-surface-card, #0d0d0d);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    color: var(--text-primary, #f0f0f2);
}

.app-gate__icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid color-mix(in srgb, var(--accent, #4dab9a) 28%, transparent);
    border-radius: var(--app-radius-control, 9px);
    background: color-mix(in srgb, var(--accent, #4dab9a) 10%, transparent);
    color: var(--accent, #66d2c3);
}

.app-gate__icon svg { width: 18px; height: 18px; stroke-width: 1.9; }
.app-gate__body { min-width: 0; }

.app-gate__eyebrow {
    margin-bottom: 5px;
    color: var(--text-muted, #77777f);
    font-family: var(--app-font-mono, 'DM Mono', monospace);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.app-gate h2 {
    max-width: 760px;
    margin: 0;
    color: inherit;
    font-size: clamp(19px, 1.7vw, 26px);
    font-weight: 680;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.app-gate p { max-width: 820px; margin: 8px 0 0; overflow-wrap: anywhere; color: var(--text-secondary, #a1a1aa); font-size: 14px; line-height: 1.5; }
.app-gate p strong { color: var(--text-primary, #f0f0f2); font-weight: 650; }
.app-gate__proof { margin: 0 0 7px !important; color: var(--text-primary, #f0f0f2) !important; font-size: 13px !important; font-weight: 620; }
.app-gate__detail { max-width: 720px !important; }
.app-gate__limit { margin-top: 9px !important; color: var(--text-muted, #77777f) !important; font-size: 12px !important; }

.app-gate__history {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px !important;
    color: var(--text-muted, #77777f) !important;
}

.app-gate__history svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; }
.app-gate__action { display: grid; justify-items: end; gap: 7px; min-width: min(240px, 100%); }
.app-gate__action .app-action-btn { white-space: nowrap; }
.app-gate__action small { color: var(--text-muted, #77777f); font-size: 11px; }

.app-gate__usage {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 11px;
    color: var(--text-muted, #77777f);
    font-family: var(--app-font-mono, 'DM Mono', monospace);
    font-size: 11px;
}

.app-gate__usage strong { color: var(--text-primary, #f0f0f2); }
.app-gate--exhausted .app-gate__icon { border-color: rgba(245, 158, 11, .24); background: rgba(245, 158, 11, .08); color: #f0b85a; }

.app-gate--compact { grid-template-columns: auto minmax(0, 1fr) auto; padding: 14px 16px; gap: 13px; }
.app-gate--compact .app-gate__icon { width: 34px; height: 34px; }
.app-gate--compact h2 { font-size: 16px; letter-spacing: -.02em; }
.app-gate--compact p { margin-top: 5px; font-size: 12px; }
.app-gate--compact .app-gate__proof { margin-bottom: 4px !important; font-size: 11px !important; }
.app-gate--compact .app-gate__eyebrow { margin-bottom: 3px; font-size: 9px; }

:is(html.light, html[data-theme="light"]) .app-gate {
    border-color: rgba(18, 24, 28, .1);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .035), inset 0 1px 0 #fff;
    color: #111817;
}

:is(html.light, html[data-theme="light"]) .app-gate p { color: #5d6866; }
:is(html.light, html[data-theme="light"]) .app-gate p strong,
:is(html.light, html[data-theme="light"]) .app-gate__usage strong { color: #111817; }

@media (max-width: 720px) {
    .app-gate,
    .app-gate--compact { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 13px; padding: 16px; }
    .app-gate__action { grid-column: 1 / -1; width: 100%; justify-items: stretch; min-width: 0; }
    .app-gate__action .app-action-btn { width: 100%; justify-content: center; white-space: normal; text-align: center; }
    .app-gate__action small { text-align: center; }
    .app-gate h2 { font-size: clamp(18px, 6vw, 22px); overflow-wrap: anywhere; }
}

@media (max-width: 340px) {
    .app-gate,
    .app-gate--compact { grid-template-columns: 1fr; }
    .app-gate__icon { width: 36px; height: 36px; }
}
