/* Experiment 9 - Retailer Tomatoes v2 (server-rendered, no JS) */

.tm2-page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

.tm2-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.tm2-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tm2-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #ef4444, #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tm2-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tm2-actions {
    display: flex;
    gap: 0.5rem;
}

.tm2-btn {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ef4444, #22c55e);
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.tm2-btn:hover {
    filter: brightness(1.1);
}

.tm2-btn-ghost {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tm2-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.tm2-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.tm2-card h3 {
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.tm2-card h2 + h2,
.tm2-card table + h2,
.tm2-card p + h2 {
    margin-top: 1.5rem;
}

.tm2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 860px) {
    .tm2-grid {
        grid-template-columns: 1fr;
    }
}

.tm2-statbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.5rem;
    margin-bottom: 1.25rem;
}

.tm2-stat {
    display: flex;
    flex-direction: column;
}

.tm2-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.tm2-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tm2-pos {
    color: var(--accent-green);
}

.tm2-neg {
    color: #f87171;
}

.tm2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.tm2-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.4rem 0.75rem 0.4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.tm2-table td {
    padding: 0.45rem 0.75rem 0.45rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.tm2-table tr:last-child td {
    border-bottom: none;
}

.tm2-table-total td {
    font-weight: 700;
    color: var(--text-primary);
}

.tm2-scroll {
    overflow-x: auto;
}

.tm2-history {
    min-width: 1100px;
    white-space: nowrap;
}

.tm2-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0.75rem 0 0;
}

.tm2-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.35);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-size: 0.92rem;
}

.tm2-rules {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

.tm2-rules li {
    margin-bottom: 0.5rem;
}

.tm2-field {
    margin-bottom: 1rem;
    max-width: 480px;
}

.tm2-field label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tm2-field input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
}

.tm2-field input:focus {
    outline: 2px solid var(--accent-green);
    outline-offset: 1px;
}

.tm2-field-inline {
    max-width: 160px;
    margin-bottom: 0;
}

.tm2-decision {
    border-color: rgba(34, 197, 94, 0.35);
}

.tm2-start {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tm2-final-score {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0 0 1rem;
}

.tm2-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tm2-ranking-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.tm2-ranking-row:last-child {
    border-bottom: none;
}

.tm2-ranking-first .tm2-ranking-name,
.tm2-ranking-first .tm2-ranking-score {
    color: var(--accent-green);
}

.tm2-ranking-pos {
    width: 2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.tm2-ranking-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 600;
}

.tm2-ranking-score {
    font-weight: 700;
    color: var(--accent-green);
}

.tm2-empty {
    color: var(--text-muted);
}

/* --- message feed (email / Slack / internal) --- */

.tm2-feed {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 30rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.tm2-msg {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    background: var(--bg-secondary);
}

.tm2-msg-email {
    border-left: 3px solid #60a5fa;
}

.tm2-msg-slack {
    border-left: 3px solid #a78bfa;
}

.tm2-msg-internal {
    border-left: 3px solid #f59e0b;
}

.tm2-msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tm2-msg-sender {
    font-weight: 700;
    color: var(--text-primary);
}

.tm2-msg-channel {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.05rem 0.5rem;
}

.tm2-msg-subject {
    font-weight: 600;
    color: var(--text-secondary);
}

.tm2-msg-body {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

/* --- order grid --- */

.tm2-order-grid td input {
    width: 7rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
}

.tm2-order-grid td input:focus {
    outline: 2px solid var(--accent-green);
    outline-offset: 1px;
}

.tm2-price-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.tm2-forecast {
    border: 1px dashed rgba(96, 165, 250, 0.6);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.tm2-forecast p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tm2-badge {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
