/* FindGoodAI Online Interactive Apps (enqueued only on /apps/ routes) */

.apps-hub-wrap,
.app-detail-wrap {
    padding-bottom: 48px;
}

.apps-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 24px;
}

.apps-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.app-hub-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    transition: border-color 0.16s ease, background-color 0.16s ease;
}

.app-hub-card:hover {
    border-color: #111418;
    background: #fcfcfd;
}

.app-hub-card[hidden] {
    display: none;
}

.app-hub-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fga-app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    color: #174d38;
    border: 1px solid #e6e8ec;
    flex: none;
}

.app-hub-cat {
    font-size: 11.5px;
    font-weight: 600;
    color: #525866;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.app-hub-card h2 {
    margin: 4px 0 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #111418;
}

.app-hub-card p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.65;
    color: #525866;
    flex: 1;
}

.app-hub-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 650;
    color: #111418;
}

.app-hub-card-cta svg {
    width: 15px;
    height: 15px;
}

/* Detail Header & Stage Shell */
.app-detail-hero {
    margin: 12px 0 22px;
}

.app-detail-meta {
    margin-bottom: 10px;
}

.app-detail-hero h1 {
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.2;
    font-weight: 750;
    color: #111418;
    margin: 0 0 10px;
}

.app-detail-sub {
    max-width: 780px;
    font-size: 15px;
    line-height: 1.7;
    color: #525866;
}

.app-stage {
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 36px;
    max-width: 100%;
    min-width: 0;
}

.app-stage *,
.app-stage *::before,
.app-stage *::after {
    box-sizing: border-box;
}

.app-stage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid #e6e8ec;
    margin-bottom: 18px;
}

.app-stage-head h2 {
    margin: 8px 0 6px;
    font-size: 20px;
    line-height: 1.3;
    color: #111418;
}

.app-stage-head p {
    margin: 0;
    max-width: 680px;
    font-size: 13.5px;
    line-height: 1.65;
    color: #525866;
}

.app-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.app-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.03em;
    color: #174d38;
    background: #eff5f2;
    border: 1px solid #d5e5dd;
}

.app-pill-privacy {
    color: #111418;
    background: #f7f8fa;
    border-color: #e6e8ec;
}

.app-tabs,
.hcw-unit-switch,
.hcw-lang-pills,
.app-seg-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px;
    background: #f3f4f6;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    max-width: 100%;
}

.app-seg-btn {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: #525866;
    background: transparent;
    border: 0;
    white-space: nowrap;
}

.app-seg-btn:hover {
    color: #111418;
}

.app-seg-btn.is-active {
    background: #ffffff;
    color: #111418;
    box-shadow: 0 1px 2px rgba(17, 20, 24, 0.08);
}

.app-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 550;
    color: #525866;
    background: #f3f4f6;
    border: 1px solid transparent;
    white-space: nowrap;
}

.app-chip:hover {
    background: #e9ecf0;
    color: #111418;
}

.app-chip.is-active {
    background: #111418;
    color: #ffffff;
    border-color: #111418;
}

.app-ghost-btn,
.app-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 8px;
    border: 1px solid #e6e8ec;
    background: #ffffff;
    color: #111418;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.app-ghost-btn:hover,
.app-upload-btn:hover {
    background: #f7f8fa;
    border-color: #cfd4dc;
}

.app-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.app-kpi {
    min-width: 0;
    padding: 12px 14px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.app-kpi small {
    display: block;
    font-size: 11.5px;
    color: #525866;
    margin-bottom: 4px;
}

.app-kpi strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #111418;
    word-break: break-word;
}

.app-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* Height Comparison Simulator */
.hcw-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #e6e8ec;
}

.hcw-header-copy {
    min-width: 0;
    flex: 1 1 360px;
}

.hcw-title {
    margin: 8px 0 6px;
    font-size: 20px;
    color: #111418;
}

.hcw-subtitle {
    margin: 0;
    font-size: 13.5px;
    color: #525866;
    line-height: 1.6;
}

.hcw-header-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.hcw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 0;
    border-bottom: 1px solid #e6e8ec;
    margin-bottom: 18px;
}

.hcw-presets,
.hcw-toolbar-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
}

.hcw-toolbar-label {
    font-size: 12px;
    font-weight: 600;
    color: #868c98;
    margin-right: 4px;
}

.hcw-eye-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 550;
    color: #111418;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
}

.hcw-body {
    display: grid;
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.hcw-controls,
.hcw-stage-panel {
    min-width: 0;
    max-width: 100%;
}

.hcw-person-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hcw-person-card {
    min-width: 0;
    padding: 14px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-left: 3px solid var(--hcw-person-color, #174d38);
    border-radius: 10px;
}

.hcw-person-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.hcw-person-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hcw-person-color, #174d38);
    flex: none;
}

.hcw-name-input {
    min-width: 0;
    flex: 1 1 90px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid #cfd4dc;
    border-radius: 7px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #111418;
}

.hcw-swatches {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.hcw-swatch {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid transparent;
    padding: 0;
}

.hcw-swatch.is-active {
    outline: 2px solid #111418;
    outline-offset: 1px;
}

.hcw-remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    color: #525866;
    font-size: 15px;
    line-height: 1;
}

.hcw-remove-btn:hover {
    color: #b91c1c;
    border-color: #fca5a5;
}

.hcw-height-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hcw-slider {
    min-width: 0;
    flex: 1 1 auto;
    accent-color: var(--hcw-person-color, #174d38);
}

.hcw-metric-box,
.hcw-imperial-box {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
}

.hcw-metric-box[hidden],
.hcw-imperial-box[hidden] {
    display: none;
}

.hcw-num-input {
    width: 60px;
    height: 32px;
    padding: 4px 6px;
    border: 1px solid #cfd4dc;
    border-radius: 7px;
    background: #ffffff;
    font-size: 13px;
    font-weight: 650;
    text-align: right;
    color: #111418;
}

.hcw-num-ft {
    width: 44px;
}

.hcw-num-in {
    width: 50px;
}

.hcw-unit-tag {
    font-size: 11.5px;
    color: #525866;
}

.hcw-style-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.hcw-style-btn {
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #e6e8ec;
    background: #ffffff;
    color: #525866;
    font-size: 12px;
    font-weight: 550;
}

.hcw-style-btn.is-active {
    background: #111418;
    color: #ffffff;
    border-color: #111418;
}

.hcw-add-btn {
    width: 100%;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px dashed #cfd4dc;
    background: #ffffff;
    font-size: 13px;
    font-weight: 650;
    color: #111418;
}

.hcw-add-btn:hover:not(:disabled) {
    background: #f7f8fa;
    border-color: #111418;
}

.hcw-count-pill {
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #525866;
    font-size: 11px;
}

.hcw-svg-wrap {
    width: 100%;
    max-width: 100%;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    overflow: hidden;
    background: #fbfcfd;
}

.hcw-svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.hcw-diff-bar {
    margin-top: 14px;
    padding: 14px 16px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hcw-diff-pill {
    display: inline-block;
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eff5f2;
    color: #174d38;
    font-size: 12px;
    font-weight: 700;
}

.hcw-diff-headline {
    font-size: 15px;
    color: #111418;
}

.hcw-diff-callout {
    margin: 0;
    font-size: 13px;
    color: #525866;
}

.hcw-footer {
    margin-top: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.hcw-export-status {
    font-size: 12.5px;
    font-weight: 600;
    color: #174d38;
}

/* Face Shape Analyzer */
.fr-layout {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.fr-canvas-box,
.fr-main {
    min-width: 0;
    max-width: 100%;
}

.fr-canvas-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
}

.fr-canvas {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e6e8ec;
    background: #ffffff;
}

.fr-presets,
.fr-photo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.fr-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.fr-slider-card {
    min-width: 0;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.fr-slider-card input[type="range"] {
    width: 100%;
    accent-color: #174d38;
}

.fr-slider-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #525866;
    margin-bottom: 6px;
}

.fr-slider-top strong {
    color: #111418;
}

.fr-thirds-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    gap: 2px;
    margin: 14px 0 10px;
}

.fr-tip {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.65;
    color: #111418;
}

/* Token / Video Cost & VRAM Calculators */
.calc-pane[hidden] {
    display: none;
}

.mcw-text-estimator {
    padding: 14px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    margin-bottom: 14px;
}

.mcw-estimator-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.mcw-est-stats {
    color: #174d38;
}

.mcw-estimator-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.mcw-estimator-row textarea {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    resize: vertical;
}

.mcw-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.app-control-box {
    min-width: 0;
    padding: 14px;
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.app-control-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.app-control-top span {
    font-weight: 500;
    color: #525866;
}

.app-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-slider-row input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #174d38;
}

.app-slider-row input[type="number"] {
    width: 82px;
    height: 34px;
    padding: 4px 8px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    background: #ffffff;
    font-weight: 650;
    font-size: 13px;
}

.app-select {
    width: 100%;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid #cfd4dc;
    border-radius: 8px;
    background: #ffffff;
    font-size: 13px;
    color: #111418;
}

.app-select-compact {
    width: auto;
    height: 34px;
}

.app-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 560px;
}

.app-table th,
.app-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid #e6e8ec;
    white-space: nowrap;
}

.app-table th {
    background: #f7f8fa;
    font-size: 12px;
    font-weight: 650;
    color: #525866;
}

.app-table tr:last-child td {
    border-bottom: 0;
}

.app-table tr.is-best {
    background: #f4faf7;
}

.app-table-link {
    color: #111418;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-inline-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 650;
    background: #eff5f2;
    color: #174d38;
}

.app-inline-tag-muted {
    background: #f3f4f6;
    color: #525866;
}

/* VRAM Calculator */
.vram-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.vram-label {
    display: block;
    font-size: 12.5px;
    font-weight: 650;
    margin-bottom: 8px;
    color: #111418;
}

.vram-license {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: #525866;
}

.vram-meter {
    display: flex;
    height: 12px;
    border-radius: 999px;
    background: #e6e8ec;
    overflow: hidden;
    margin: 14px 0 16px;
}

.vram-meter-weights {
    background: #174d38;
}

.vram-meter-overhead {
    background: #2563eb;
}

.vram-hw-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.vram-hw-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    background: #ffffff;
}

.vram-hw-card strong {
    display: block;
    font-size: 12.5px;
    margin-bottom: 4px;
    color: #111418;
}

.vram-hw-card span {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 650;
    padding: 2px 8px;
    border-radius: 999px;
}

.vram-hw-card.is-ok span {
    background: #eff5f2;
    color: #174d38;
}

.vram-hw-card.is-tight span {
    background: #fef3c7;
    color: #92400e;
}

.vram-hw-card.is-no span {
    background: #fee2e2;
    color: #991b1b;
}

.vram-hw-card.is-cloud span {
    background: #eff6ff;
    color: #1e40af;
}

/* Flowchart Studio */
.flow-layout {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.flow-editor-pane,
.flow-preview-pane {
    min-width: 0;
    max-width: 100%;
}

.flow-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cfd4dc;
    border-radius: 10px;
    background: #fbfcfd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #111418;
    resize: vertical;
}

.flow-meta-bar {
    margin: 6px 0 12px;
    font-size: 12px;
    color: #525866;
}

.flow-svg-wrap {
    width: 100%;
    max-width: 100%;
    min-height: 300px;
    padding: 16px;
    background: #fbfcfd;
    border: 1px solid #e6e8ec;
    border-radius: 12px;
    overflow-x: auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
}

.flow-svg-wrap svg {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    margin-inline: auto;
    flex: none;
}

.flow-svg-wrap.is-lr svg {
    max-width: none;
    margin-inline: 0;
}

/* Editorial Content, FAQ & Cross-links */
.app-editorial-body {
    margin-top: 32px;
    max-width: 860px;
}

.app-editorial-body h2 {
    margin: 28px 0 12px;
    font-size: 21px;
    color: #111418;
}

.app-editorial-body p,
.app-editorial-body li {
    color: #363d49;
    line-height: 1.75;
}

.app-editorial-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13.5px;
    border: 1px solid #e6e8ec;
}

.app-editorial-body th,
.app-editorial-body td {
    padding: 10px 12px;
    border: 1px solid #e6e8ec;
    text-align: left;
}

.app-editorial-body th {
    background: #f7f8fa;
    font-weight: 650;
}

.app-faq {
    margin-top: 28px;
}

.app-editorial-body details.collection-faq {
    margin-bottom: 10px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.app-editorial-body details.collection-faq summary {
    font-weight: 650;
    color: #111418;
    cursor: pointer;
}

.app-editorial-body details.collection-faq p {
    margin: 10px 0 0;
}

.app-more-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.app-more-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
}

.app-more-card:hover {
    border-color: #111418;
}

.app-more-card strong {
    display: block;
    font-size: 13.5px;
    color: #111418;
}

.app-more-card small {
    display: block;
    font-size: 11.5px;
    color: #525866;
}

@media (max-width: 1024px) {
    .apps-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hcw-body,
    .fr-layout,
    .flow-layout {
        grid-template-columns: 1fr;
    }

    .hcw-stage-panel {
        order: -1;
    }

    .mcw-controls-grid,
    .vram-controls {
        grid-template-columns: 1fr;
    }

    .vram-hw-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-more-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .apps-hub-grid,
    .app-kpi-grid,
    .fr-controls,
    .vram-hw-grid,
    .app-more-grid {
        grid-template-columns: 1fr;
    }

    .app-stage {
        padding: 16px;
    }

    .mcw-estimator-row {
        flex-direction: column;
    }

    .mcw-estimator-row button {
        width: 100%;
    }
}
