/*
 * Heardfix look of the member and OwnWeb admin panels, over Filament's own theme: brand fonts, a surface app shell
 * around the canvas, flat bordered cards. Plain CSS on Filament's stable `fi-` classes, so the package needs no
 * Tailwind build. Colours come from heardfix-tokens.css and the panel palettes (HeardfixTheme): the dark palette
 * below is the only one set here, Filament having no palette per mode.
 */

:root {
    --heardfix-card-radius: 1rem;
    --heardfix-control-radius: 0.625rem;
    --heardfix-line: var(--gray-200);
    --heardfix-card-edge: 0 0 0 1px var(--heardfix-line), 0 1px 2px rgb(0 0 0 / 0.03);
}

.dark {
    --heardfix-line: rgb(255 255 255 / 0.08);
    --heardfix-card-edge: 0 0 0 1px var(--heardfix-line);
}

/*
 * Dark mode: the accent turns apricot, as the kit asks, and the secondary text lightens to stay readable on the
 * plum canvas. `:root.dark` outweighs the `:root` palettes Filament prints in the page.
 */
:root.dark {
    --primary-50: #fff7ef;
    --primary-100: #fff0e4;
    --primary-200: #ffe3d0;
    --primary-300: #ffd3b8;
    --primary-400: #ffc39e;
    --primary-500: #f4b286;
    --primary-600: #e39d72;
    --primary-700: #c27f58;
    --primary-800: #9a6345;
    --primary-900: #6f4834;
    --primary-950: #46301f;
    --gray-400: #d0bdd6;
    --gray-500: #a993b1;
}

/* App shell: surface sidebar and topbar framing the quiet canvas. */
.fi-body {
    background: var(--heardfix-canvas-quiet);
}

.fi-topbar {
    box-shadow: 0 1px 0 var(--heardfix-line);
}

@media (min-width: 1024px) {
    .fi-sidebar.fi-sidebar-open,
    .fi-body-has-sidebar-collapsible-on-desktop .fi-sidebar {
        background: var(--heardfix-surface);
        box-shadow: 1px 0 0 var(--heardfix-line);
    }
}

/* Brand name in the display face, for a host that replaces the logo by its name. */
.fi-logo {
    font-family: var(--heardfix-display-font);
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}

.heardfix-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
}

.heardfix-logo svg {
    height: 100%;
    width: auto;
}

/* The panel the logo opens, like "admin": a quiet tag, never part of the name. */
.heardfix-logo-label {
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--heardfix-surface-subtle);
    color: var(--heardfix-text-secondary);
    font-family: var(--heardfix-text-font);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* The main action: cream on prune, prune on apricot in dark mode, never white on apricot. */
.fi-btn.fi-color-primary:not(.fi-outlined) {
    --bg: var(--heardfix-action);
    --text: var(--heardfix-action-text);
    --hover-bg: var(--heardfix-action-hover);
    --hover-text: var(--heardfix-action-text);
    --dark-bg: var(--heardfix-action);
    --dark-text: var(--heardfix-action-text);
    --dark-hover-bg: var(--heardfix-action-hover);
    --dark-hover-text: var(--heardfix-action-text);
}

/* Navigation: a quiet group label, the current page tinted with the brand colour. */
.fi-sidebar-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.fi-sidebar-item-btn {
    border-radius: var(--heardfix-control-radius);
}

/* Apricot as the kit allows it on light screens: a soft background behind prune text, never small apricot text. */
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn,
.fi-tabs-item.fi-active {
    background: var(--heardfix-accent-soft);
}

.fi-sidebar-item-badge-ctn .fi-badge {
    background: var(--heardfix-accent-soft);
    color: var(--heardfix-text);
    box-shadow: none;
}

.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
    font-weight: 600;
}

/* Page header: the brand display face, breadcrumbs as a discreet path above it. */
.fi-header-heading {
    font-family: var(--heardfix-display-font);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.fi-header .fi-breadcrumbs {
    font-size: 0.8125rem;
}

/* Cards: sections, tables, stats, charts and the sign-in box share one flat, bordered surface. */
.fi-section:not(.fi-section-not-contained):not(.fi-aside),
.fi-section.fi-aside > .fi-section-content-ctn,
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-simple-main {
    border-radius: var(--heardfix-card-radius);
    box-shadow: var(--heardfix-card-edge);
}

.fi-section:not(.fi-section-not-contained):not(.fi-aside).fi-compact {
    border-radius: var(--heardfix-control-radius);
}

.fi-section-header-heading {
    font-weight: 600;
    letter-spacing: -0.005em;
}

/* Read-only details: small caps labels set the values apart without bold everywhere. */
.fi-in-entry-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.dark .fi-in-entry-label {
    color: var(--gray-400);
}

/* Tables: a tinted header row with small caps, like the details labels. */
.fi-ta-header-cell {
    background: var(--gray-50);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.dark .fi-ta-header-cell {
    background: rgb(255 255 255 / 0.02);
    color: var(--gray-400);
}

/* Controls' borders at 3:1 against their surface at least; focus, error and disabled keep Filament's colours. */
.fi-input-wrp:not(.fi-invalid):not(.fi-disabled):not(:focus-within),
.fi-checkbox-input:not(.fi-invalid):not(:disabled):not(:checked):not(:focus) {
    --tw-ring-color: var(--heardfix-border-control);
}

/* Keyboard focus of the kit, 2 px at 3 px off the control, readable on every surface where Filament's ring fades. */
.fi-btn:focus-visible,
.fi-link:focus-visible,
.fi-icon-btn:focus-visible,
.fi-fo-toggle-buttons-input:focus-visible + .fi-btn,
.fi-sidebar-item-btn:focus-visible,
.fi-tabs-item:focus-visible {
    outline: 2px solid var(--heardfix-focus);
    outline-offset: 3px;
}

/* Controls: softer corners, pill badges, buttons in Figtree SemiBold like the kit. */
.fi-btn {
    font-weight: 600;
}

.fi-btn,
.fi-input-wrp,
.fi-dropdown-panel {
    border-radius: var(--heardfix-control-radius);
}

.fi-badge {
    border-radius: 999px;
}

/* Figures of the dashboard in the display face, like the commercial site. */
.fi-wi-stats-overview-stat-value {
    font-family: var(--heardfix-display-font);
    letter-spacing: -0.01em;
}

/* Report page: reports of the topic per day, as a bar sparkline. */
.heardfix-trend-chart {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.heardfix-trend-chart svg {
    flex: 1;
    height: 2rem;
}

.heardfix-trend-bar {
    fill: var(--primary-500);
}

.heardfix-trend-hit {
    fill: transparent;
}

.heardfix-trend-day:hover .heardfix-trend-hit {
    fill: var(--primary-50);
}

.dark .heardfix-trend-day:hover .heardfix-trend-hit {
    fill: rgb(255 255 255 / 0.06);
}

.heardfix-trend-day:hover .heardfix-trend-bar {
    fill: var(--primary-700);
}

/* 7, 30 and 60 days, as a small segmented control above the chart. */
.heardfix-trend-periods {
    display: inline-flex;
    margin-bottom: 0.5rem;
    padding: 0.125rem;
    border-radius: var(--heardfix-control-radius);
    background: var(--gray-100);
}

.dark .heardfix-trend-periods {
    background: rgb(255 255 255 / 0.06);
}

.heardfix-trend-periods button {
    padding: 0.125rem 0.5rem;
    border-radius: calc(var(--heardfix-control-radius) - 0.125rem);
    font-size: 0.75rem;
    color: var(--gray-500);
    cursor: pointer;
}

.heardfix-trend-periods button[aria-pressed="true"] {
    background: var(--heardfix-surface);
    color: var(--heardfix-text);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.dark .heardfix-trend-periods button[aria-pressed="true"] {
    background: var(--gray-800);
}

.heardfix-trend-peak {
    stroke: var(--gray-300);
    stroke-dasharray: 3 3;
}

.heardfix-trend-baseline {
    stroke: var(--heardfix-line);
}

.heardfix-trend-peak-label,
.heardfix-trend-summary {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-variant-numeric: tabular-nums;
}

.heardfix-trend-peak-label {
    line-height: 1;
}

.heardfix-trend-summary {
    margin-top: 0.25rem;
}

/* Report page: battery, free memory and storage as bars, orange then red when running low. */
.heardfix-gauge {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.heardfix-gauge-track {
    height: 0.375rem;
    border-radius: 999px;
    background: var(--gray-100);
    overflow: hidden;
}

.dark .heardfix-gauge-track {
    background: rgb(255 255 255 / 0.08);
}

.heardfix-gauge-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--gray-400);
}

.heardfix-gauge-warning .heardfix-gauge-fill {
    background: var(--warning-500);
}

.heardfix-gauge-danger .heardfix-gauge-fill {
    background: var(--danger-500);
}

.heardfix-gauge-warning > span {
    color: var(--warning-700);
}

.heardfix-gauge-danger > span {
    color: var(--danger-600);
}

/* Topic page: reports by OS and version, one bar per value. */
.heardfix-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    font-size: 0.875rem;
}

.heardfix-breakdown li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.5rem;
}

.heardfix-breakdown-value {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.heardfix-breakdown-value .fi-icon {
    color: var(--gray-500);
}

.heardfix-breakdown-count {
    font-variant-numeric: tabular-nums;
}

.heardfix-breakdown-percent {
    margin-inline-start: 0.25rem;
    color: var(--gray-500);
}

.heardfix-breakdown-track {
    grid-column: 1 / -1;
    height: 0.25rem;
}

.heardfix-breakdown-fill {
    background: var(--primary-500);
}

/* Filters above a list: one slim toolbar row, small caps labels, compact fields, no "Filters" title. */
.fi-ta-filters-above-content-ctn {
    padding-block: 0.75rem;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 1rem;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters > :not(.fi-ta-filters-header) {
    flex: 1;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters-heading {
    display: none;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters-header {
    padding-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.fi-ta-filters-above-content-ctn .fi-fo-field-label-content {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gray-500);
}

.fi-ta-filters-above-content-ctn .fi-input-wrp {
    font-size: 0.875rem;
}

.fi-ta-filters-above-content-ctn .fi-select-input,
.fi-ta-filters-above-content-ctn .fi-input {
    padding-block: 0.375rem;
}

/* Unboxed tabs (the diagnostics of a report): flush left like the title, not centred. */
.fi-tabs:not(.fi-contained) {
    align-self: flex-start;
    margin-inline: 0;
    padding: 0.25rem;
    box-shadow: var(--heardfix-card-edge);
}

/* A choice shown as a segmented control, in the style of the list tabs. */
.heardfix-segmented.fi-btn-group {
    gap: 0.25rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
    background: var(--heardfix-surface);
    box-shadow: var(--heardfix-card-edge);
}

.heardfix-segmented .fi-btn {
    border-radius: 0.5rem;
    background: transparent;
    box-shadow: none;
    color: var(--gray-600);
    font-weight: 500;
}

.heardfix-segmented .fi-btn:hover {
    background: var(--gray-50);
}

:where(.dark) .heardfix-segmented .fi-btn {
    color: var(--gray-400);
}

.heardfix-segmented input:checked + .fi-btn,
.heardfix-segmented .fi-btn[aria-pressed="true"] {
    background: var(--heardfix-accent-soft);
    color: var(--heardfix-text);
}

.heardfix-segmented .fi-btn {
    gap: 0.375rem;
}

.heardfix-segmented .fi-icon {
    color: currentColor;
    opacity: 0.7;
}

.heardfix-segmented-count {
    min-width: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--warning-50);
    color: var(--warning-700);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

/* The filters of a list sit side by side, each as wide as it needs. */
.fi-ta-filters-above-content-ctn .fi-ta-filters > .fi-sc {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters > .fi-sc > * {
    width: auto;
    min-width: 12rem;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters > .fi-sc > :has(.heardfix-segmented) {
    min-width: 0;
}

/* Resetting the filters is secondary: a quiet link, not a red one. */
.fi-ta-filters-above-content-ctn .fi-ta-filters-header .fi-link {
    color: var(--gray-500);
    font-weight: 500;
}

.fi-ta-filters-above-content-ctn .fi-ta-filters-header .fi-link:hover {
    color: var(--gray-950);
}

/* A topic in the "Group into a topic" field: its title, then its kind and report count as badges. */
.heardfix-topic-option {
    display: inline-flex;
    flex-direction: column;
    gap: 0.25rem;
}

.heardfix-topic-option-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Once chosen, a topic shows its title only: its preview below the field carries the rest. */
.fi-select-input-value-badges-ctn .heardfix-topic-option-badges {
    display: none;
}

/* A chosen topic in "Group into a topic": badges, then a short text and a link to the topic. */
.heardfix-topic-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.heardfix-topic-preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.heardfix-topic-preview-text {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.dark .heardfix-topic-preview-text {
    color: var(--gray-400);
}

.heardfix-topic-option-title {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* "Group into a topic": what the reporters wrote, each description cut to 5 lines until unfolded. */
.heardfix-reported-texts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.heardfix-reported-text-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.heardfix-reported-text-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
    white-space: pre-line;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.heardfix-reported-text-description.heardfix-reported-text-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
}

.dark .heardfix-reported-text-description,
.dark .heardfix-reported-text-others {
    color: var(--gray-400);
}

.heardfix-reported-text-toggle {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
}

.dark .heardfix-reported-text-toggle {
    color: var(--primary-400);
}

.heardfix-reported-text-others {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* The open list of topics would cover the save button: the field keeps room for it below. */
.heardfix-group-topics-field:has([aria-expanded="true"]) {
    padding-bottom: 16rem;
}

/* Tooltip of a suggested topic: why it is suggested, as a small card of data. */
.heardfix-suggestion-tip {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.25rem 0.125rem;
    font-size: 0.8125rem;
}

.heardfix-suggestion-tip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.heardfix-suggestion-tip-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.heardfix-suggestion-tip-open {
    flex-shrink: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-300);
}

.tippy-box[data-theme~='light'] .heardfix-suggestion-tip-open {
    color: var(--primary-700);
}

.heardfix-suggestion-tip-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    white-space: pre-line;
    opacity: 0.85;
}

.heardfix-suggestion-tip-excerpt.heardfix-suggestion-tip-excerpt-expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
    max-height: 16rem;
    overflow-y: auto;
}

.heardfix-suggestion-tip-more {
    font-weight: 600;
    color: var(--primary-300);
}

.tippy-box[data-theme~='light'] .heardfix-suggestion-tip-more {
    color: var(--primary-700);
}

.heardfix-suggestion-tip-part {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.heardfix-suggestion-tip-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

.heardfix-suggestion-tip-percent {
    font-variant-numeric: tabular-nums;
    opacity: 1;
}

.heardfix-suggestion-tip-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.heardfix-suggestion-tip-chip {
    padding: 0.125rem 0.5rem;
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    border-radius: 999px;
}

.heardfix-suggestion-tip-issue {
    border-radius: 0.375rem;
    text-decoration: none;
    color: var(--primary-300);
    border-color: color-mix(in srgb, var(--primary-300) 50%, transparent);
}

.tippy-box[data-theme~='light'] .heardfix-suggestion-tip-issue {
    color: var(--primary-700);
    border-color: color-mix(in srgb, var(--primary-700) 40%, transparent);
}

.heardfix-suggestion-tip-bar {
    height: 0.375rem;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 15%, transparent);
    overflow: hidden;
}

.heardfix-suggestion-tip-bar > div {
    height: 100%;
    border-radius: 999px;
    background: var(--primary-400);
}

/* Report page: the ungrouped reports like this one, one a line. */
.heardfix-similar-reports {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;

    & li {
        display: flex;
        align-items: center;
        gap: 0.375rem;
    }
}

.heardfix-similar-report-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
}

.heardfix-similar-report-title:hover {
    text-decoration: underline;
}

/* AI banner, first on the report: one line per proposal, settled from its buttons. */
.heardfix-ai-banner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--heardfix-card-radius);
    background: var(--primary-50);
    box-shadow: 0 0 0 1px var(--primary-200);

    :where(.dark) & {
        background: rgb(255 195 158 / 0.06);
        box-shadow: 0 0 0 1px rgb(255 195 158 / 0.2);
    }
}

.heardfix-ai-banner.is-settled {
    padding: 0.625rem 1rem;
}

.heardfix-ai-groupings {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.heardfix-ai-grouping {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;

    & a {
        font-weight: 500;
    }

    & a:hover {
        text-decoration: underline;
    }
}

.heardfix-ai-banner-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.heardfix-ai-banner-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
}

.heardfix-ai-banner-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary-700);
}

.heardfix-ai-banner-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.heardfix-ai-banner-status {
    font-size: 0.875rem;
    color: var(--heardfix-text-secondary);
}

.heardfix-ai-proposals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heardfix-ai-proposal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--heardfix-control-radius);
    background: white;
    box-shadow: var(--heardfix-card-edge);

    :where(.dark) & {
        background: rgb(255 255 255 / 0.03);
    }

    &.is-settled {
        opacity: 0.6;
    }
}

.heardfix-ai-proposal-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.heardfix-ai-proposal-line {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.heardfix-ai-proposal-title {
    font-weight: 500;
}

.heardfix-ai-proposal-detail {
    font-size: 0.8125rem;
    color: var(--heardfix-text-secondary);
}

.heardfix-ai-proposal-destination {
    flex-shrink: 0;
    font-weight: 500;

    & a:hover {
        text-decoration: underline;
    }
}

.heardfix-ai-proposal-excerpt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heardfix-ai-proposal-buttons {
    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
}

@media (max-width: 40rem) {
    .heardfix-ai-proposal {
        flex-direction: column;
        align-items: stretch;
    }

    .heardfix-ai-proposal-detail {
        flex-wrap: wrap;
    }
}

/* Store reply preview, in the close form: a review of each store with the reply under it, in the look of that store. */
.heardfix-store-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heardfix-store-switch {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.125rem;
    border-radius: 9999px;
    background: var(--gray-100);

    :where(.dark) & {
        background: rgb(255 255 255 / 0.08);
    }

    & button {
        padding: 0.25rem 0.875rem;
        border-radius: 9999px;
        font-size: 0.8125rem;
        font-weight: 500;
        color: var(--heardfix-text-secondary);
    }

    & button.is-active {
        background: white;
        color: var(--gray-950);
        box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
    }
}

/* The stores show their reviews on white: the preview keeps their look in dark mode too. */
.heardfix-store-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    color: #1f1f1f;
    background: white;
    box-shadow: var(--heardfix-card-edge);
}

.heardfix-store-review-head,
.heardfix-store-meta,
.heardfix-store-reply-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.heardfix-store-text {
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-line;
}

/* The reply is typed right in the store look: no field chrome, growing with its text. */
.heardfix-store-reply-input {
    width: 100%;
    min-height: 4.5em;
    padding: 0;
    overflow: hidden;
    resize: none;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.45;
    color: inherit;
    background: transparent;
    border: 0;
    outline: none;

    &::placeholder {
        font-style: italic;
        color: #8e8e93;
    }
}

.heardfix-store-reply-foot {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #8e8e93;
}

.heardfix-store-card.is-google_play {
    border-radius: 0.75rem;
    font-family: Roboto, Arial, sans-serif;

    & .heardfix-store-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border-radius: 9999px;
        font-weight: 500;
        color: white;
        background: #5f6368;
    }

    & .heardfix-store-author {
        font-size: 0.875rem;
    }

    & .heardfix-store-meta {
        font-size: 0.75rem;
        color: #5f6368;
    }

    & .heardfix-store-stars {
        letter-spacing: 0.05em;
        color: #01875f;
    }

    & .heardfix-store-reply {
        display: flex;
        flex-direction: column;
        gap: 0.875rem;
        padding: 0.75rem;
        border-radius: 0.5rem;
        background: #f1f3f4;
    }

    & .heardfix-store-reply-head {
        justify-content: space-between;
        font-size: 0.75rem;
        color: #5f6368;
    }

    & .heardfix-store-reply-author {
        font-weight: 500;
        color: #1f1f1f;
    }
}

.heardfix-store-card.is-app_store {
    border-radius: 0.875rem;
    background: #f2f2f7;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;

    & .heardfix-store-review-head {
        justify-content: space-between;
    }

    & .heardfix-store-title {
        font-weight: 600;
    }

    & .heardfix-store-date,
    & .heardfix-store-meta {
        font-size: 0.8125rem;
        color: #8e8e93;
    }

    & .heardfix-store-stars {
        color: #ff9500;
    }

    & .heardfix-store-reply {
        display: flex;
        flex-direction: column;
        gap: 0.875rem;
        padding-top: 0.5rem;
    }

    & .heardfix-store-reply-head {
        justify-content: space-between;
        font-size: 0.8125rem;
        color: #8e8e93;
    }

    & .heardfix-store-reply-author {
        font-weight: 600;
        color: #1f1f1f;
    }
}

/*
 * A zone of a preview that can be typed in: dashed until focused, with an "Editable" badge in its bottom corner, inside
 * it so it covers nothing around. The previews look like what is sent, not like a form: nothing else tells they take text.
 */
.heardfix-editable {
    position: relative;
    display: block;
    margin: -0.375rem;
    padding: 0.375rem 0.375rem 1.875rem;
    border-radius: 0.5rem;
    outline: 1px dashed rgb(90 61 107 / 0.4);
    cursor: text;
    transition: background-color 120ms ease, outline-color 120ms ease;

    &:hover {
        background-color: rgb(90 61 107 / 0.05);
    }

    &:focus-within {
        background-color: transparent;
        outline: 2px solid var(--primary-500);
    }

    /* A one-line zone keeps its badge on its right, centred. */
    &.is-inline {
        padding: 0.375rem 7rem 0.375rem 0.375rem;

        & .heardfix-editable-badge {
            top: 50%;
            bottom: auto;
            translate: 0 -50%;
        }
    }
}

.heardfix-editable-badge {
    position: absolute;
    right: 0.375rem;
    bottom: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    font-family: var(--font-family, inherit);
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: #5a3d6b;
    background: white;
    box-shadow: 0 0 0 1px rgb(90 61 107 / 0.3);
    pointer-events: none;

    & svg {
        width: 0.75rem;
        height: 0.75rem;
    }

    .heardfix-editable:focus-within & {
        display: none;
    }
}

/* Email to reporters, in the close and write forms: written in the look they receive it, from the app. */
.heardfix-email-preview {
    overflow: hidden;
    border-radius: 0.75rem;
    box-shadow: var(--heardfix-card-edge);
}

/* The email is light whatever the panel mode: the preview keeps the colours of its mail theme, in hex like it. */
.heardfix-email-envelope {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.125rem 1.25rem 1rem;
    color: #18181b;
    background: white;
    border-bottom: 1px solid #e4e4e7;
}

.heardfix-email-subject {
    width: 100%;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: inherit;
    background: transparent;
    border: 0;
    outline: none;

    &::placeholder {
        color: #71717a;
    }
}

.heardfix-email-error {
    font-size: 0.8125rem;
    color: var(--danger-600);
}

.heardfix-email-from {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;

    & > span:last-child {
        display: flex;
        flex-wrap: wrap;
        column-gap: 0.375rem;
    }
}

.heardfix-email-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    font-weight: 600;
    color: white;
    background: #52525b;
}

.heardfix-email-sender {
    font-weight: 600;
}

.heardfix-email-address,
.heardfix-email-to {
    color: #71717a;
}

.heardfix-email-to {
    flex-basis: 100%;
}

.heardfix-email-canvas {
    padding-bottom: 1.5rem;
    color: #52525b;
    background: #fafafa;
}

.heardfix-email-header {
    padding: 1.25rem 0;
    font-size: 1.1875rem;
    font-weight: 700;
    text-align: center;
    color: #18181b;
}

.heardfix-email-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 36rem;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border: 1px solid #e4e4e7;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);

    @media (max-width: 40rem) {
        margin-inline: 0.75rem;
        padding: 1.25rem;
    }
}

.heardfix-email-body {
    width: 100%;
    min-height: 6em;
    padding: 0;
    overflow: hidden;
    resize: none;
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: inherit;
    background: transparent;
    border: 0;
    outline: none;
}

.heardfix-email-button {
    align-self: center;
    padding: 0.5rem 1.125rem;
    border-radius: 0.25rem;
    font-weight: 600;
    color: white;
    background: #18181b;
}

.heardfix-email-note {
    font-size: 0.875rem;
}
