/**
 * Share Target page styles
 */
.cg-share-target {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cg-share-target__header {
    text-align: center;
    margin-bottom: 24px;
}

.cg-share-target__logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.cg-share-target__header h1 {
    font-size: 22px;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.cg-share-url-display {
    display: none;
    font-size: 13px;
    color: #067F38;
    word-break: break-all;
    text-decoration: none;
    padding: 8px 12px;
    background: #f0faf4;
    border-radius: 6px;
    margin-bottom: 16px;
}

.cg-share-url-display:hover {
    text-decoration: underline;
}

/* ── Progress steps ─────────────────────────────────── */
.cg-share-progress {
    display: none;
    margin-bottom: 16px;
}

.cg-progress-steps {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.cg-progress-step {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

/* Connector line between steps */
.cg-progress-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 6px;
}

.cg-progress-step--done:not(:last-child)::after,
.cg-progress-step--active:not(:last-child)::after {
    background: #067F38;
}

.cg-progress-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    background: #ddd;
    color: #888;
    transition: background 0.2s, color 0.2s;
}

.cg-progress-step--done .cg-progress-step__num {
    background: #067F38;
    color: #fff;
}

.cg-progress-step--active .cg-progress-step__num {
    background: #067F38;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(6, 127, 56, 0.2);
}

.cg-progress-step__label {
    font-size: 11px;
    color: #888;
    margin-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg-progress-step--active .cg-progress-step__label,
.cg-progress-step--done .cg-progress-step__label {
    color: #067F38;
    font-weight: 600;
}

/* ── Status messages ────────────────────────────────── */
.cg-share-status {
    display: none;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    align-items: flex-start;
    gap: 8px;
}

.cg-share-status--loading {
    background: #f0faf4;
    color: #067F38;
    display: flex;
}

.cg-share-status--error {
    background: #fef2f2;
    color: #dc2626;
    display: flex;
}

.cg-share-status--warning {
    background: #fffbeb;
    color: #d97706;
    display: flex;
}

.cg-share-status__text {
    flex: 1;
}

/* Spinner */
.cg-share-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #067F38;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cg-spin 0.8s linear infinite;
    flex-shrink: 0;
    margin-top: 2px;
}

@keyframes cg-spin {
    to { transform: rotate(360deg); }
}

/* ── Results ────────────────────────────────────────── */
.cg-share-results {
    display: none;
}

/* Summary header */
.cg-results-summary {
    background: #f0faf4;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 20px;
}

.cg-results-summary__title {
    font-size: 13px;
    color: #555;
    margin: 0 0 8px;
    line-height: 1.4;
}

.cg-results-summary__co2 {
    margin-bottom: 4px;
}

.cg-results-summary__co2-value {
    font-size: 40px;
    font-weight: 700;
    color: #067F38;
    line-height: 1.1;
}

.cg-results-summary__co2-unit {
    font-size: 16px;
    font-weight: 600;
    color: #067F38;
}

.cg-results-summary__social-cost {
    font-size: 13px;
    color: #666;
    margin: 6px 0 0;
}

/* Results title */
.cg-results-title {
    font-size: 18px;
    font-weight: 700;
    color: #067F38;
    text-align: center;
    margin: 0 0 16px;
}

/* Geographic context */
.cg-results-summary__geo {
    font-size: 12px;
    color: #888;
    margin: 6px 0 0;
}

/* Item detail cards */
.cg-share-items-detail {
    margin-bottom: 20px;
}

.cg-item-card {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.cg-item-card:last-child {
    border-bottom: none;
}

.cg-item-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    line-height: 1.4;
}

.cg-item-link:hover .cg-item-name {
    text-decoration: underline;
}

.cg-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.cg-item-price {
    font-size: 13px;
    color: #555;
}

.cg-item-separator {
    font-size: 13px;
    color: #ccc;
}

.cg-item-carbon {
    font-size: 13px;
    font-weight: 700;
    color: #067F38;
}

.cg-item-description {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cg-item-naics {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.cg-item-offset-cost {
    font-size: 12px;
    color: #067F38;
    font-weight: 600;
    margin-top: 3px;
}

/* Action buttons */
.cg-share-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.cg-share-btn {
    flex: 1;
    display: inline-block;
    text-align: center;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    line-height: 1.3;
}

.cg-share-btn--primary {
    background: #067F38;
    color: #fff;
}

.cg-share-btn--primary:hover {
    background: #056830;
    color: #fff;
}

.cg-share-btn--secondary {
    background: #f0faf4;
    color: #067F38;
    border: 1px solid #067F38;
}

.cg-share-btn--secondary:hover {
    background: #e0f5ea;
}

/* Details link */
.cg-results-details-link {
    text-align: center;
    margin: 16px 0 0;
    font-size: 13px;
}

.cg-results-details-link a {
    color: #067F38;
    text-decoration: none;
}

.cg-results-details-link a:hover {
    text-decoration: underline;
}

/* Fallback textarea */
.cg-share-fallback {
    display: none;
    margin-top: 16px;
}

.cg-share-fallback__textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.cg-share-fallback__textarea:focus {
    border-color: #067F38;
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 127, 56, 0.2);
}

/* Bookmarklet section */
.cg-bookmarklet-section {
    margin: 24px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.cg-bookmarklet-section h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #1a1a1a;
}

.cg-bookmarklet-section p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.cg-bookmarklet-link-container {
    text-align: center;
    margin-bottom: 16px;
}

.cg-bookmarklet-link {
    display: inline-block;
    padding: 12px 24px;
    background: #067F38;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: grab;
}

.cg-bookmarklet-link:hover {
    background: #056830;
    color: #fff;
}

.cg-bookmarklet-instructions {
    margin-top: 12px;
}

.cg-bookmarklet-instructions summary {
    cursor: pointer;
    font-size: 14px;
    color: #067F38;
    font-weight: 600;
}

.cg-bookmarklet-instructions__content {
    padding: 12px 0;
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.cg-bookmarklet-instructions__content h4 {
    margin: 12px 0 4px;
    font-size: 14px;
    color: #1a1a1a;
}

.cg-bookmarklet-instructions__content ol {
    padding-left: 20px;
    margin: 4px 0;
}
