/* ──────────────────────────────────────────────────────────────────────────
   Self-hosted Google Reviews — refined Swift Accounting style
   Container: <div data-google-reviews data-show-summary="true">…</div>
────────────────────────────────────────────────────────────────────────── */
.gr-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #0f2a44;
    max-width: 100%;
}

/* ── Summary panel ─────────────────────────────────────────────────────── */
.gr-summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    padding: 32px 36px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15,42,68,.04);
    margin-bottom: 28px;
    align-items: center;
}
.gr-summary-left {
    display: flex; flex-direction: column; align-items: center;
    padding-right: 36px;
    border-right: 1px solid #e8eaed;
}
.gr-summary-rating {
    font-size: 64px; font-weight: 700; color: #0f2a44;
    line-height: 1; letter-spacing: -2px;
    background: linear-gradient(135deg, #0f2a44 0%, #2ca6a4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gr-summary-stars {
    color: #fbbc04; font-size: 18px; letter-spacing: 2px;
    margin-top: 6px;
    text-shadow: 0 1px 0 rgba(251,188,4,.25);
}
.gr-summary-count {
    font-size: 13px; color: #5f6368; margin-top: 8px; font-weight: 500;
}
.gr-summary-google-tag {
    margin-top: 12px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: #fff; border: 1px solid #dadce0; border-radius: 12px;
    font-size: 11px; color: #5f6368; font-weight: 600;
}

.gr-distribution {
    display: flex; flex-direction: column; gap: 8px;
    justify-content: center;
}
.gr-dist-row {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: #5f6368;
}
.gr-dist-num {
    width: 14px; text-align: right; font-weight: 600; color: #0f2a44;
    font-size: 13px;
}
.gr-dist-bar {
    flex: 1;
    height: 10px;
    background: #eef2f6;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.gr-dist-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbc04 0%, #f9a825 100%);
    border-radius: 999px;
    transition: width .8s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 1px 2px rgba(251,188,4,.3);
    min-width: 4px;
}
.gr-dist-count {
    width: 28px; text-align: right;
    font-size: 12px; color: #94a3b8; font-weight: 600;
}

/* ── Toolbar — write button + sort ─────────────────────────────────── */
.gr-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 0 4px;
}
.gr-write-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2ca6a4 0%, #249e9c 100%);
    border: none; border-radius: 999px;
    color: #fff; font-size: 13.5px; font-weight: 600;
    text-decoration: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(44,166,164,.3);
    transition: transform .15s, box-shadow .15s;
    font-family: inherit;
}
.gr-write-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44,166,164,.4);
}
.gr-write-btn svg { flex-shrink: 0; }

.gr-sort-wrap { position: relative; margin-left: auto; }
.gr-sort-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 999px;
    color: #0f2a44; font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: inherit;
    transition: border-color .15s, background .15s;
}
.gr-sort-btn:hover { background: #f8fafc; border-color: #2ca6a4; }
.gr-sort-btn svg { width: 14px; height: 14px; flex-shrink: 0; opacity: .7; }
.gr-sort-btn span[data-gr-sort-label] { color: #2ca6a4; font-weight: 700; }
.gr-sort-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
    background: #fff; border-radius: 12px;
    box-shadow: 0 8px 28px rgba(15,42,68,.15);
    border: 1px solid #e2e8f0;
    min-width: 200px; padding: 6px;
    display: none;
    transform-origin: top right;
    animation: gr-fade-in .15s ease;
}
@keyframes gr-fade-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.gr-sort-menu.open { display: block; }
.gr-sort-opt {
    display: block; width: 100%; text-align: left;
    background: none; border: none; cursor: pointer;
    padding: 9px 14px; font-size: 13px; color: #0f2a44;
    font-family: inherit; border-radius: 8px;
    transition: background .12s;
}
.gr-sort-opt:hover { background: #f8fafc; }
.gr-sort-opt.active { color: #2ca6a4; font-weight: 700; background: rgba(44,166,164,.08); }

/* ── Review cards — grid layout for breathing room ─────────────────── */
.gr-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}
.gr-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 1px 3px rgba(15,42,68,.04);
    transition: transform .2s, box-shadow .2s, border-color .2s;
    display: flex; flex-direction: column; gap: 10px;
    position: relative;
}
.gr-card::before {
    content: '';
    position: absolute; top: 18px; right: 18px;
    width: 24px; height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.18 1.48-4.97 2.31-8.16 2.31-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: .6;
}
.gr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15,42,68,.08);
    border-color: rgba(44,166,164,.4);
}

.gr-card-hdr {
    display: flex; align-items: center; gap: 12px;
}
.gr-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #2ca6a4 0%, #1a7a78 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15,42,68,.1);
}
.gr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gr-author-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; padding-right: 32px; }
.gr-author-name {
    font-size: 14px; font-weight: 700; color: #0f2a44;
    line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gr-author-name a { color: inherit; text-decoration: none; }
.gr-author-name a:hover { color: #2ca6a4; }
.gr-stars-row {
    display: flex; align-items: center; gap: 8px;
}
.gr-stars {
    color: #fbbc04; font-size: 14px; letter-spacing: 1.5px;
    line-height: 1;
}
.gr-time { font-size: 12px; color: #94a3b8; font-weight: 500; }

.gr-text {
    font-size: 13.5px; color: #334155; line-height: 1.6;
    word-wrap: break-word;
    /* Truncate to 5 lines, expand on click */
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.gr-text.expanded { -webkit-line-clamp: unset; }
.gr-readmore {
    background: none; border: none; padding: 4px 0 0;
    color: #2ca6a4; font-size: 12.5px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    align-self: flex-start;
    transition: color .12s;
}
.gr-readmore:hover { color: #1a7a78; }

.gr-empty {
    text-align: center; padding: 60px 20px;
    color: #94a3b8; font-size: 14px;
    background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 12px;
}

/* ── Mobile ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .gr-summary { grid-template-columns: 1fr; gap: 24px; padding: 24px 20px; }
    .gr-summary-left { padding-right: 0; padding-bottom: 24px; border-right: none; border-bottom: 1px solid #e8eaed; }
    .gr-summary-rating { font-size: 52px; }
    .gr-toolbar { flex-direction: column; align-items: stretch; }
    .gr-sort-wrap { margin-left: 0; }
    .gr-sort-btn { justify-content: space-between; width: 100%; }
    .gr-list { grid-template-columns: 1fr; }
}
