/* PEBBLE-V5-CATCH-UP-2026-05-20 — frame styling for the Catch-Up surface.
   Tokens-aware; matches existing pebble chassis vocabulary. */

.catchup-shell {
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius, 8px);
    margin: 0 auto;
    max-width: 1240px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(13,42,74,0.04);
}

.catchup-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--gl-border);
    background: var(--gl-brand-paper);
}
.catchup-hero-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.catchup-greeting {
    font-size: 15px; font-weight: 700; color: var(--gl-text); margin: 0;
    line-height: 1.4;
}
.catchup-count {
    color: var(--gl-brand, #1BA8D8); font-weight: 700;
}
.catchup-fresh {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--gl-text-3);
    background: var(--gl-surface-3); padding: 3px 10px; border-radius: 999px;
    white-space: nowrap;
    justify-self: end;
}
.catchup-refresh-btn {
    background: none; border: none; cursor: pointer; padding: 0; font-size: 12px;
    color: var(--gl-text-3);
}
.catchup-refresh-btn:hover { color: var(--gl-brand); }

.catchup-section {
    padding: 14px 16px 16px;
}
.catchup-section + .catchup-section { border-top: 1px solid var(--gl-border); }
.catchup-section-title {
    font-size: 12px; font-weight: 600; color: var(--gl-text-2);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 0 10px;
}

.catchup-empty, .catchup-empty-clusters {
    margin: 0; padding: 16px 0;
    color: var(--gl-text-3); font-size: 13px; font-style: italic; text-align: center;
}

.catchup-todos { list-style: none; padding: 0; margin: 0; }
.catchup-todo-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 10px 0; border-top: 1px solid var(--gl-border);
}
.catchup-todo-row:first-child { border-top: none; }
.catchup-todo-main { flex: 1; min-width: 0; }
.catchup-todo-title { font-size: 13px; font-weight: 600; color: var(--gl-text); }
.catchup-todo-sub { font-size: 12px; color: var(--gl-text-2); margin-top: 2px; line-height: 1.4; }
.catchup-todo-from { font-size: 11px; color: var(--gl-text-3); margin-top: 2px; }
.catchup-todo-actions { display: flex; gap: 5px; flex-shrink: 0; align-items: center; }

.catchup-action-btn {
    font-size: 11px; font-weight: 500; padding: 5px 12px; border-radius: 999px;
    border: 1px solid var(--gl-border); background: var(--gl-surface); cursor: pointer;
    color: var(--gl-text);
}
.catchup-action-btn:hover { background: var(--gl-brand-soft); border-color: var(--gl-brand); }
.catchup-action-reply { background: var(--gl-brand-soft); border-color: var(--gl-brand); color: var(--gl-brand-strong); }
.catchup-action-archive { color: var(--gl-text-2); }
.catchup-action-dismiss {
    border: none; background: none; cursor: pointer; color: var(--gl-text-3);
    font-size: 14px; padding: 2px 6px;
}
.catchup-action-dismiss:hover { color: #15803d; }
.catchup-show-more {
    border: none; background: none; color: var(--gl-brand); font-size: 12px;
    cursor: pointer; padding: 8px 0 0; font-weight: 500;
}

.catchup-source-tag {
    display: inline-block;
    background: var(--gl-surface-3); color: var(--gl-text-2);
    font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
    margin-right: 6px; vertical-align: 2px;
}

.catchup-topics-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.catchup-topic-card {
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: 8px;
    overflow: hidden;
}
.catchup-topic-head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; background: var(--gl-surface-2);
    border-bottom: 1px solid var(--gl-border);
}
.catchup-topic-icon { font-size: 14px; }
.catchup-topic-name {
    font-size: 13px; font-weight: 600; color: var(--gl-text); margin: 0; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.catchup-topic-menu {
    background: none; border: none; color: var(--gl-text-3); cursor: pointer; padding: 0 4px;
}
.catchup-topic-menu:hover { color: var(--gl-text); }
.catchup-cluster-items {
    list-style: none; padding: 10px 14px; margin: 0;
}
.catchup-cluster-item {
    font-size: 12px; color: var(--gl-text); padding: 4px 0;
    border-top: 1px solid var(--gl-border);
    line-height: 1.4;
}
.catchup-cluster-item:first-child { border-top: none; }

/* PEBBLE-CATCHUP-RENDER-HYDRATE-001 — hydrated cluster rows.
   Sender · Subject · preview · time, with a left-edge account stripe.
   Subject truncates first, then preview; sender + time stay readable. */
.catchup-cluster-row {
    display: grid;
    grid-template-columns: 3px 100px 1fr auto;
    grid-template-areas:
        "stripe sender  subject time"
        "stripe sender  preview time";
    column-gap: 8px; row-gap: 1px;
    align-items: baseline;
    padding: 6px 0 6px 0;
    border-top: 1px solid var(--gl-border);
    font-size: 12px; line-height: 1.35;
    overflow: hidden;
}
.catchup-cluster-row:first-child { border-top: none; }
.catchup-cluster-row .row-account-chip {
    grid-area: stripe;
    width: 3px; align-self: stretch;
    background: var(--gl-text-4);
    border-radius: 2px;
}
.catchup-cluster-row.catchup-account-r .row-account-chip { background: var(--gl-account-r); }
.catchup-cluster-row.catchup-account-p .row-account-chip { background: var(--gl-account-p); }
.catchup-cluster-row.catchup-account-c .row-account-chip { background: var(--gl-account-c); }
.catchup-cluster-row .row-sender {
    grid-area: sender;
    font-weight: 600; color: var(--gl-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.catchup-cluster-row .row-subject {
    grid-area: subject;
    color: var(--gl-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.catchup-cluster-row .row-preview {
    grid-area: preview;
    color: var(--gl-text-3); font-size: 11px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.catchup-cluster-row .row-time {
    grid-area: time;
    color: var(--gl-text-3); font-size: 11px;
    white-space: nowrap;
}
.catchup-cluster-row-bare {
    /* Missing from items_by_id — display id as a bare row rather than nothing. */
    color: var(--gl-text-3); font-style: italic;
}
.catchup-topic-foot {
    padding: 8px 14px; background: var(--gl-surface-2);
    border-top: 1px solid var(--gl-border);
    font-size: 11px; color: var(--gl-brand);
}

@media (max-width: 768px) {
    .catchup-shell { margin: 8px; }
    .catchup-hero { padding: 14px 16px 10px; }
    .catchup-hero-line { align-items: flex-start; flex-direction: column; }
    .catchup-fresh { justify-self: start; }
    .catchup-greeting { font-size: 15px; }
    .catchup-section { padding: 12px 16px 14px; }
    .catchup-topics-grid { grid-template-columns: 1fr; }
    .catchup-todo-row { flex-direction: column; }
    .catchup-todo-actions { width: 100%; justify-content: flex-end; }
}

/* PEBBLE-CATCHUP-SUGGESTED-TODOS-002 — top-of-Catch-Up "Suggested to-dos" cards.
   Per-account stripe down the left edge, title + primary action pill on row 1,
   sender · subject on row 2, expandable "Why" + "Not now" on row 3. */
.catchup-std-stack { display: flex; flex-direction: column; gap: 8px; }
.catchup-std-card {
    position: relative;
    display: flex; align-items: stretch;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius, 8px);
    overflow: hidden;
    box-shadow: var(--gl-shadow-sm);
}
.catchup-std-stripe {
    width: 4px; flex-shrink: 0;
    background: var(--gl-text-4);
}
.catchup-std-card.catchup-account-r .catchup-std-stripe { background: var(--gl-account-r); }
.catchup-std-card.catchup-account-p .catchup-std-stripe { background: var(--gl-account-p); }
.catchup-std-card.catchup-account-c .catchup-std-stripe { background: var(--gl-account-c); }
.catchup-std-body {
    flex: 1; min-width: 0;
    padding: 10px 12px 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    align-items: start;
}
.catchup-std-row1 {
    display: contents;
}
.catchup-std-main {
    min-width: 0;
    display: flex; align-items: flex-start; gap: 10px;
    flex-direction: column;
}
.catchup-std-title {
    flex: 1; min-width: 0;
    font-size: 14px; font-weight: 700; color: var(--gl-text);
    line-height: 1.35;
}
.catchup-std-primary {
    flex-shrink: 0;
    grid-column: 2;
    grid-row: 1;
    background: var(--gl-brand-soft); color: var(--gl-brand-strong);
    border: 1px solid color-mix(in srgb, var(--gl-brand) 46%, #fff 54%);
    border-radius: 999px;
    padding: 6px 13px; font-size: 12px; font-weight: 700;
    cursor: pointer;
}
.catchup-std-primary:hover:not(:disabled) { border-color: var(--gl-brand); background: color-mix(in srgb, var(--gl-brand-soft) 76%, #fff 24%); }
.catchup-std-primary:disabled { opacity: 0.6; cursor: default; }
.catchup-std-sender {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 12px; color: var(--gl-text-2);
    line-height: 1.4;
}
.catchup-std-route-note {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid var(--gl-border);
    background: var(--gl-brand-paper);
    color: var(--gl-brand-strong);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.catchup-std-row3 {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--gl-border);
    margin-top: 4px;
    padding-top: 7px;
}
.catchup-std-why, .catchup-std-notnow {
    background: none; border: none; cursor: pointer;
    font-size: 11px; color: var(--gl-text-3); padding: 2px 0;
    font-weight: 600;
}
.catchup-std-why:hover { color: var(--gl-brand); }
.catchup-std-notnow:hover { color: var(--gl-text); }
.catchup-std-why-body {
    grid-column: 1 / -1;
    margin-top: 4px; padding: 6px 10px;
    background: var(--gl-surface-3); border-radius: 6px;
    font-size: 12px; color: var(--gl-text-2); line-height: 1.4;
}
.catchup-std-card-routed {
    border-color: color-mix(in srgb, var(--gl-brand) 42%, var(--gl-border) 58%);
    background: color-mix(in srgb, var(--gl-brand-paper) 45%, #fff 55%);
}
.catchup-std-handoff-note {
    margin-top: 4px;
    padding: 7px 9px;
    border-radius: var(--gl-radius-sm, 6px);
    background: var(--gl-done-bg);
    color: var(--gl-done);
    font-size: 12px;
    font-weight: 650;
}
.catchup-std-handoff-note a { color: inherit; text-decoration: underline; }
.catchup-std-handoff-note-error {
    background: var(--gl-gated-bg);
    color: var(--gl-gated);
}
.catchup-std-overflow { margin-top: 8px; }

@media (max-width: 768px) {
    .catchup-std-body { grid-template-columns: 1fr; }
    .catchup-std-primary {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }
}

/* PEBBLE-V5-STREAM-4-JUMP-LINKS-2026-05-20 */
.catchup-jumplink {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 7px 10px; margin: 0;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    border-radius: var(--gl-radius-sm, 6px);
    font-size: 12px; color: var(--gl-text-2);
}
.catchup-jumplink-btn {
    margin-left: auto;
    color: var(--gl-brand); text-decoration: none; font-weight: 600;
    padding: 3px 10px; border: 1px solid var(--gl-brand); border-radius: 999px;
}
.catchup-jumplink-btn:hover { background: var(--gl-brand-soft); }
.catchup-jumplink-overview { font-style: italic; }
