/* HelpMyAgent Services UI — v3.1.7. Shared by web account and MCP Apps. */
.hma-services {
    --hma-services-bg: #f7f9fc;
    --hma-services-panel: #ffffff;
    --hma-services-panel-soft: #f1f5fb;
    --hma-services-text: #0f172a;
    --hma-services-muted: #64748b;
    --hma-services-line: #dce4ef;
    --hma-services-accent: #2563eb;
    --hma-services-accent-strong: #1748b5;
    --hma-services-good: #0f8a58;
    --hma-services-bad: #b42318;
    --hma-services-shadow: 0 12px 34px rgba(15, 23, 42, .07);
    color: var(--hma-services-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-width: 0;
}

.hma-services *,
.hma-services *::before,
.hma-services *::after { box-sizing: border-box; }

.hma-services button,
.hma-services input,
.hma-services select,
.hma-services textarea { font: inherit; }

.hma-services-shell {
    overflow: hidden;
    border: 1px solid var(--hma-services-line);
    border-radius: 22px;
    background: var(--hma-services-panel);
    box-shadow: var(--hma-services-shadow);
}

.hma-services-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hma-services-line);
    background: linear-gradient(135deg, rgba(37, 99, 235, .07), rgba(37, 99, 235, 0) 52%), var(--hma-services-panel);
}

.hma-services-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hma-services-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: linear-gradient(145deg, #2f7ee6, #1d4ed8);
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.04em;
}
.hma-services-brand > div { display: grid; gap: 1px; min-width: 0; }
.hma-services-eyebrow { color: var(--hma-services-muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.hma-services-title { font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }

.hma-services-account { display: grid; justify-items: end; gap: 2px; text-align: right; }
.hma-services-account-label { color: var(--hma-services-good); font-size: 11px; font-weight: 700; }
.hma-services-account-balance { font-size: 14px; white-space: nowrap; }

.hma-services-main { min-height: 260px; padding: 22px; background: var(--hma-services-bg); }
.hma-services-intro { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.hma-services-intro h2,
.hma-services-view h2,
.hma-services-detail-head h2 { margin: 0; color: var(--hma-services-text); font-size: clamp(24px, 4vw, 34px); line-height: 1.12; letter-spacing: -.035em; }
.hma-services-intro p,
.hma-services-view-head p,
.hma-services-detail-head p { margin: 9px 0 0; color: var(--hma-services-muted); font-size: 14px; line-height: 1.55; }

.hma-services-search { display: block; max-width: 620px; margin: 18px auto 0; }
.hma-services-search input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--hma-services-line);
    border-radius: 14px;
    outline: 0;
    background: var(--hma-services-panel);
    color: var(--hma-services-text);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}
.hma-services-search input:focus { border-color: var(--hma-services-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }

.hma-services-section { margin-top: 18px; }
.hma-services-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.hma-services-section-head h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.hma-services-section-head > span { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; border-radius: 999px; background: var(--hma-services-panel-soft); color: var(--hma-services-muted); font-size: 12px; font-weight: 700; }

.hma-services-category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hma-services-category-card,
.hma-services-service-card {
    appearance: none;
    width: 100%;
    border: 1px solid var(--hma-services-line);
    background: var(--hma-services-panel);
    color: var(--hma-services-text);
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.hma-services-category-card:hover,
.hma-services-service-card:hover { transform: translateY(-1px); border-color: rgba(37, 99, 235, .42); box-shadow: 0 10px 24px rgba(15, 23, 42, .07); }
.hma-services-category-card:focus-visible,
.hma-services-service-card:focus-visible,
.hma-services-primary:focus-visible,
.hma-services-breadcrumb button:focus-visible { outline: 3px solid rgba(37, 99, 235, .22); outline-offset: 2px; }

.hma-services-category-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; min-height: 128px; padding: 16px; border-radius: 16px; }
.hma-services-category-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(37, 99, 235, .09); color: var(--hma-services-accent); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.hma-services-category-body { display: grid; align-content: start; gap: 5px; min-width: 0; }
.hma-services-category-body strong { font-size: 15px; line-height: 1.25; }
.hma-services-category-body small { color: var(--hma-services-muted); font-size: 12px; line-height: 1.4; }
.hma-services-category-count { grid-column: 1 / -1; color: var(--hma-services-muted); font-size: 11px; font-weight: 700; }

.hma-services-breadcrumb { display: flex; align-items: center; gap: 7px; overflow: hidden; margin-bottom: 18px; color: var(--hma-services-muted); font-size: 12px; }
.hma-services-breadcrumb button { appearance: none; border: 0; padding: 0; background: none; color: var(--hma-services-accent); cursor: pointer; font: inherit; }
.hma-services-breadcrumb .is-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hma-services-muted); }
.hma-services-breadcrumb-separator { opacity: .55; }

.hma-services-view-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.hma-services-view-kicker { display: block; margin-bottom: 5px; color: var(--hma-services-accent); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.hma-services-service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.hma-services-service-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; min-height: 132px; padding: 15px; border-radius: 15px; }
.hma-services-service-body { display: grid; align-content: start; gap: 5px; min-width: 0; }
.hma-services-service-category { color: var(--hma-services-accent); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.hma-services-service-body strong { font-size: 15px; line-height: 1.25; }
.hma-services-service-body small { display: -webkit-box; overflow: hidden; color: var(--hma-services-muted); font-size: 12px; line-height: 1.42; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.hma-services-service-meta { display: grid; align-content: space-between; justify-items: end; gap: 8px; min-width: 110px; color: var(--hma-services-muted); font-size: 11px; }
.hma-services-service-meta > span { color: var(--hma-services-text); font-weight: 750; white-space: nowrap; }
.hma-services-service-meta code { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hma-services-muted); font-size: 10px; }

.hma-services-detail-head { display: flex; align-items: start; justify-content: space-between; gap: 22px; }
.hma-services-detail-head > div:first-child { min-width: 0; }
.hma-services-price { flex: 0 0 auto; min-width: 122px; padding: 12px 14px; border: 1px solid var(--hma-services-line); border-radius: 14px; background: var(--hma-services-panel); text-align: right; }
.hma-services-price small { display: block; color: var(--hma-services-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.hma-services-price strong { display: block; margin-top: 3px; font-size: 14px; }
.hma-services-technical { margin: 14px 0 18px; padding: 9px 12px; overflow: auto; border-radius: 10px; background: #0f172a; color: #dbeafe; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; white-space: nowrap; }

.hma-services-form-section { padding: 18px; border: 1px solid var(--hma-services-line); border-radius: 16px; background: var(--hma-services-panel); }
.hma-services-form-section > h3 { margin: 0 0 14px; font-size: 15px; }
.hma-services-form { display: grid; gap: 13px; }
.hma-services-field { display: grid; gap: 6px; min-width: 0; }
.hma-services-field-label { font-size: 12px; font-weight: 700; }
.hma-services-field-help { color: var(--hma-services-muted); font-size: 11px; line-height: 1.4; }
.hma-services-field input,
.hma-services-field select,
.hma-services-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--hma-services-line);
    border-radius: 10px;
    background: var(--hma-services-panel);
    color: var(--hma-services-text);
    outline: 0;
}
.hma-services-field input,
.hma-services-field select { height: 42px; padding: 0 11px; }
.hma-services-field textarea { min-height: 96px; padding: 10px 11px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.hma-services-field input:focus,
.hma-services-field select:focus,
.hma-services-field textarea:focus { border-color: var(--hma-services-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }
.hma-services-fieldset { display: grid; gap: 11px; min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--hma-services-line); border-radius: 12px; }
.hma-services-fieldset legend { padding: 0 5px; font-size: 12px; font-weight: 750; }
.hma-services-form-actions { display: flex; justify-content: flex-end; margin-top: 3px; }
.hma-services-primary { appearance: none; min-height: 42px; padding: 0 17px; border: 0; border-radius: 11px; background: linear-gradient(180deg, var(--hma-services-accent), var(--hma-services-accent-strong)); color: #fff; cursor: pointer; font-weight: 750; }
.hma-services-primary:disabled { opacity: .55; cursor: default; }

.hma-services-loading,
.hma-services-empty,
.hma-services-message { padding: 22px; border: 1px dashed var(--hma-services-line); border-radius: 14px; background: var(--hma-services-panel); color: var(--hma-services-muted); text-align: center; font-size: 13px; }
.hma-services-message { margin-top: 15px; border-style: solid; }
.hma-services-message--error { border-color: rgba(180, 35, 24, .26); background: rgba(180, 35, 24, .05); color: var(--hma-services-bad); }

.hma-services-result { margin-top: 16px; padding: 17px; border: 1px solid var(--hma-services-line); border-radius: 16px; background: var(--hma-services-panel); }
.hma-services-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hma-services-result-head h3 { margin: 0; font-size: 16px; }
.hma-services-result-billing { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.hma-services-result-billing span { padding: 4px 8px; border-radius: 999px; background: var(--hma-services-panel-soft); color: var(--hma-services-muted); font-size: 10px; font-weight: 700; }

.hma-services-data { display: grid; gap: 14px; }
.hma-services-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hma-services-summary-item { min-width: 0; padding: 11px; border: 1px solid var(--hma-services-line); border-radius: 11px; background: var(--hma-services-bg); }
.hma-services-summary-item span { display: block; overflow: hidden; color: var(--hma-services-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hma-services-summary-item strong { display: block; overflow-wrap: anywhere; margin-top: 4px; font-size: 13px; }
.hma-services-data-section { display: grid; gap: 8px; }
.hma-services-data-section h4 { margin: 0; font-size: 13px; }
.hma-services-object-grid { display: grid; border: 1px solid var(--hma-services-line); border-radius: 11px; overflow: hidden; }
.hma-services-object-row { display: grid; grid-template-columns: minmax(110px, .42fr) minmax(0, 1fr); gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--hma-services-line); font-size: 11px; }
.hma-services-object-row:last-child { border-bottom: 0; }
.hma-services-object-row > span { color: var(--hma-services-muted); }
.hma-services-object-row strong,
.hma-services-object-row code { overflow-wrap: anywhere; color: var(--hma-services-text); font-size: 11px; }
.hma-services-table-scroll { overflow: auto; border: 1px solid var(--hma-services-line); border-radius: 11px; }
.hma-services-table { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 11px; }
.hma-services-table th,
.hma-services-table td { padding: 9px 10px; border-bottom: 1px solid var(--hma-services-line); text-align: left; vertical-align: top; }
.hma-services-table th { position: sticky; top: 0; background: var(--hma-services-panel-soft); color: var(--hma-services-muted); font-size: 10px; text-transform: uppercase; }
.hma-services-table td { max-width: 280px; overflow-wrap: anywhere; }
.hma-services-table-note { display: block; padding: 8px 10px; color: var(--hma-services-muted); }
.hma-services-simple-list { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--hma-services-text); font-size: 12px; }
.hma-services-value-card { padding: 15px; border: 1px solid var(--hma-services-line); border-radius: 12px; background: var(--hma-services-bg); }
.hma-services-raw { margin-top: 14px; }
.hma-services-raw summary { cursor: pointer; color: var(--hma-services-accent); font-size: 11px; font-weight: 700; }
.hma-services-raw pre { max-height: 360px; overflow: auto; margin: 9px 0 0; padding: 12px; border-radius: 10px; background: #0f172a; color: #dbeafe; font-size: 10px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .hma-services-main { padding: 16px; }
    .hma-services-category-grid,
    .hma-services-service-grid { grid-template-columns: 1fr; }
    .hma-services-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hma-services-detail-head { display: grid; }
    .hma-services-price { width: 100%; text-align: left; }
    .hma-services-header { align-items: start; }
}

@media (max-width: 480px) {
    .hma-services-shell { border-radius: 16px; }
    .hma-services-header { padding: 14px; }
    .hma-services-main { padding: 13px; }
    .hma-services-account-label { display: none; }
    .hma-services-account-balance { font-size: 12px; }
    .hma-services-summary-grid { grid-template-columns: 1fr; }
    .hma-services-service-card { grid-template-columns: 1fr; }
    .hma-services-service-meta { justify-items: start; min-width: 0; }
    .hma-services-detail-head h2,
    .hma-services-intro h2,
    .hma-services-view h2 { font-size: 24px; }
}

@media (prefers-color-scheme: dark) {
    .hma-services[data-hma-theme="auto"],
    .hma-services:not([data-hma-theme]) {
        --hma-services-bg: #0c111b;
        --hma-services-panel: #121925;
        --hma-services-panel-soft: #182231;
        --hma-services-text: #f4f7fb;
        --hma-services-muted: #9eabc0;
        --hma-services-line: #28364a;
        --hma-services-shadow: 0 16px 40px rgba(0, 0, 0, .22);
    }
}

html[data-theme="dark"] .hma-services,
.hma-services[data-hma-theme="dark"] {
    --hma-services-bg: #0c111b;
    --hma-services-panel: #121925;
    --hma-services-panel-soft: #182231;
    --hma-services-text: #f4f7fb;
    --hma-services-muted: #9eabc0;
    --hma-services-line: #28364a;
    --hma-services-shadow: 0 16px 40px rgba(0, 0, 0, .22);
}

html[data-theme="light"] .hma-services,
.hma-services[data-hma-theme="light"] {
    --hma-services-bg: #f7f9fc;
    --hma-services-panel: #ffffff;
    --hma-services-panel-soft: #f1f5fb;
    --hma-services-text: #0f172a;
    --hma-services-muted: #64748b;
    --hma-services-line: #dce4ef;
}
