/* Automatic follow-up workspace. Every rule is scoped to the email panel. */
#emailPanel { --email-line: #dfe6da; --email-muted: #68786c; padding: 24px; color: var(--ink, #203b31); }
#emailPanel *, #emailPanel *::before, #emailPanel *::after { box-sizing: border-box; }
#emailPanel [hidden] { display: none !important; }
#emailPanel .email-workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
#emailPanel .email-workspace-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
#emailPanel .email-workspace-icon { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border-radius: 14px; background: #edf3e8; color: var(--brand, #174c3c); }
#emailPanel .email-workspace-icon svg { width: 25px; height: 25px; }
#emailPanel .email-workspace-heading h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.3; }
#emailPanel .email-workspace-heading p { margin: 0; color: var(--email-muted); font-size: 13px; line-height: 1.6; }
#emailPanel .email-human-check { flex-shrink: 0; padding: 7px 10px; border-radius: 6px; color: #5e725e; background: #f3f6ed; font-size: 11px; }
#emailPanel #emailSettings { margin: 0 0 28px; padding: 18px 20px 0; border: 1px solid var(--email-line); border-radius: 12px; background: #f8faf5; scroll-margin-top: 90px; }
#emailPanel .email-connection-heading { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
#emailPanel .email-connection-heading h3 { margin: 0; font-size: 15px; font-weight: 700; }
#emailPanel .email-connection-badge, #emailPanel .email-count { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; background: #eaf0e4; color: #547148; font-size: 11px; font-weight: 600; line-height: 1.4; }
#emailPanel .email-connection-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
#emailPanel .email-connection-badge.unavailable, #emailPanel .email-connection-badge.unbound, #emailPanel .email-connection-badge.disconnected { background: #eaece6; color: #6c7468; }
#emailPanel .email-connection-badge.pending, #emailPanel .email-connection-badge.paused { background: #f5eddd; color: #886b2e; }
#emailPanel .email-connection-content { padding-bottom: 16px; }
#emailPanel .email-settings-note { color: var(--email-muted); line-height: 1.65; font-size: 12px; margin: 0; }
#emailPanel .email-settings-card { display: grid; gap: 12px; }
#emailPanel .email-settings-card p { margin: 0; }
#emailPanel .email-connection-identity { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
#emailPanel .email-settings-form { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; align-items: end; gap: 12px; margin: 14px 0 0; max-width: 860px; }
#emailPanel .email-settings-form label { display: grid; gap: 7px; min-width: 0; font-size: 12px; color: #516858; }
#emailPanel .email-settings-card .email-settings-form { grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
#emailPanel input, #emailPanel select { min-width: 0; width: 100%; max-width: 100%; height: 40px; padding: 8px 10px; border: 1px solid #d5dfd0; border-radius: 7px; background: #fff; color: var(--ink, #203b31); font: inherit; font-size: 13px; line-height: 1.4; }
#emailPanel input::placeholder { color: #929d90; }
#emailPanel button, #emailPanel .email-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; margin: 0; padding: 8px 13px; border: 1px solid #cedbc6; border-radius: 7px; background: #fff; color: var(--brand, #174c3c); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.5; cursor: pointer; box-shadow: none; transition: background .15s, border-color .15s; }
#emailPanel button:hover:not(:disabled) { background: #eff4e9; border-color: #90ab81; }
#emailPanel .email-button-primary, #emailPanel .email-settings-form button[type=submit] { border-color: var(--brand, #174c3c); background: var(--brand, #174c3c); color: white; }
#emailPanel .email-button-primary:hover:not(:disabled), #emailPanel .email-settings-form button[type=submit]:hover:not(:disabled) { background: #103e30; border-color: #103e30; }
#emailPanel .email-button-quiet { background: transparent; }
#emailPanel button:disabled { opacity: .55; cursor: wait; }
#emailPanel :is(button, input, select, summary, a):focus-visible { outline: 2px solid #497943; outline-offset: 3px; box-shadow: none; }
#emailPanel .email-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#emailPanel .email-settings-actions button:last-child { margin-left: auto; color: #86645c; }
#emailPanel .email-settings-route { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-width: 0; padding: 13px 15px; border: 1px solid #d5e1cb; border-radius: 8px; background: #eff5e8; }
#emailPanel .email-route-address { display: grid; gap: 4px; min-width: 0; }
#emailPanel .email-route-address > span { font-size: 11px; color: var(--email-muted); }
#emailPanel .email-settings-route code { display: block; max-width: 100%; color: #31573e; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }
#emailPanel .email-settings-route button { flex-shrink: 0; }
#emailPanel .email-pilot-steps { display: grid; gap: 5px; margin: 0; padding-left: 20px; color: var(--email-muted); font-size: 12px; line-height: 1.7; }
#emailPanel .email-pilot-card > button { justify-self: start; }
#emailPanel .email-pilot-status { font-size: 12px; line-height: 1.7; color: var(--email-muted); }
#emailPanel .email-pilot-card + .email-settings-note { margin-top: 12px; font-size: 11px; }
#emailPanel .email-setup-guide { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--email-line); border-radius: 0; background: transparent; }
#emailPanel .email-setup-guide > summary { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 22px 13px 0; cursor: pointer; list-style: none; font-size: 12px; color: #42664a; }
#emailPanel .email-setup-guide > summary::-webkit-details-marker { display: none; }
#emailPanel .email-setup-guide > summary::after { position: absolute; right: 2px; content: '+'; font-size: 18px; font-weight: 400; }
#emailPanel .email-setup-guide[open] > summary::after { content: '−'; }
#emailPanel .email-setup-guide > summary strong { font-weight: 600; }
#emailPanel .email-setup-guide > summary span { font-size: 11px; color: var(--email-muted); }
#emailPanel .email-setup-guide > .email-settings-note { margin: 0 0 14px; }
#emailPanel .email-setup-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 18px; padding: 0; list-style: none; counter-reset: email-steps; }
#emailPanel .email-setup-steps li { position: relative; margin: 0; padding: 0 0 0 28px; counter-increment: email-steps; font-size: 12px; line-height: 1.7; }
#emailPanel .email-setup-steps li::before { content: counter(email-steps); position: absolute; left: 0; top: 0; width: 21px; height: 21px; line-height: 21px; text-align: center; border-radius: 50%; background: #e7efdf; color: #547340; font-size: 11px; font-weight: 700; }
#emailPanel .email-setup-steps strong, #emailPanel .email-setup-steps span { display: block; }
#emailPanel .email-setup-steps span { margin-top: 3px; color: var(--email-muted); font-size: 11px; }
#emailPanel .email-provider-guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; margin-bottom: 16px; }
#emailPanel .email-provider-guide { min-width: 0; padding: 11px 13px; border: 1px solid var(--email-line); border-radius: 7px; background: #fff; font-size: 12px; }
#emailPanel .email-provider-guide summary { cursor: pointer; font-weight: 600; color: #3c6446; }
#emailPanel .email-provider-guide p { margin: 10px 0; line-height: 1.8; color: var(--email-muted); }
#emailPanel .email-provider-guide a { color: var(--brand, #174c3c); text-decoration: underline; text-underline-offset: 3px; }
#emailPanel .email-inbox-heading { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
#emailPanel .email-inbox-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#emailPanel .email-inbox-title h2 { margin: 0; font-size: 20px; line-height: 1.4; }
#emailPanel .email-inbox-heading > button { flex-shrink: 0; }
#emailPanel .email-worker-status { margin: 0 0 16px; color: var(--email-muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
#emailPanel .email-events { display: grid; gap: 16px; }
#emailPanel .email-event { display: block; min-width: 0; margin: 0; padding: 22px; border: 1px solid var(--email-line); border-radius: 12px; background: #fff; box-shadow: 0 3px 10px #203b3103; }
#emailPanel .email-event.pending { border-top: 3px solid #789563; padding-top: 20px; }
#emailPanel .email-event-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
#emailPanel .email-event-identity { min-width: 0; }
#emailPanel .email-event-heading h3 { margin: 8px 0 4px; font: 600 22px/1.4 var(--display, sans-serif); overflow-wrap: anywhere; }
#emailPanel .email-event-heading .email-event-job { margin: 0; color: #5b7060; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
#emailPanel .email-event-kind { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #f0f4ea; color: #507244; font-size: 11px; line-height: 1.4; }
#emailPanel .email-event-state { flex-shrink: 0; padding: 5px 9px; border: 1px solid #edddba; border-radius: 20px; background: #faf3e4; color: #8d6b2d; font-size: 11px; white-space: nowrap; }
#emailPanel .email-event.confirmed .email-event-state { background: #edf4e7; color: #507744; border-color: #d6e4cb; }
#emailPanel .email-event.ignored .email-event-state { background: #efefeb; color: #7a8174; border-color: #dfe2d9; }
#emailPanel .email-event.ignored { background: #fafbf8; }
#emailPanel .email-event-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #7b8777; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
#emailPanel .email-original-details { margin: 13px 0 16px; padding: 11px 0 0; border-top: 1px solid #edf0e8; }
#emailPanel .email-original-details summary { font-size: 12px; color: #67805c; cursor: pointer; }
#emailPanel .email-original-text { margin: 12px 0 0; padding: 12px 14px; border-radius: 7px; background: #f7f9f3; color: #62705e; font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
#emailPanel .email-event-form { min-width: 0; }
#emailPanel .email-match-block { margin: 0 0 18px; padding: 14px 16px; border: 1px solid #e1e8d8; border-radius: 8px; background: #f4f7ee; }
#emailPanel .email-match-block label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
#emailPanel .email-match-block select { font-weight: 400; }
#emailPanel .email-match-hint, #emailPanel .email-link-preview { margin: 8px 0 0; font-size: 11px; line-height: 1.7; color: #77846e; overflow-wrap: anywhere; }
#emailPanel .email-link-preview { color: var(--brand, #174c3c); font-weight: 600; }
#emailPanel .email-link-preview:empty { display: none; }
#emailPanel .email-review-title { margin: 0 0 11px; font-size: 13px; font-weight: 600; }
#emailPanel .email-event-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
#emailPanel .email-event-fields label { display: grid; gap: 6px; min-width: 0; font-size: 11px; color: #61755c; }
#emailPanel .email-event-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #e9eee2; }
#emailPanel .email-event-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
#emailPanel .email-event-result { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid #edf0e8; color: #72826b; font-size: 12px; }
#emailPanel .email-event-result p { margin: 0; }
#emailPanel .email-settings-error { margin: 10px 0 0; color: #a04e3c; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#emailPanel .email-settings-error:empty { display: none; }
#emailPanel .email-inbox-empty { padding: 32px 18px; border: 1px dashed #d5dfcb; border-radius: 12px; background: #fafbf7; text-align: center; }
#emailPanel .email-inbox-empty > .email-empty-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 13px; background: #eef3e7; color: #799065; font-size: 24px; }
#emailPanel .email-inbox-empty h3 { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
#emailPanel .email-inbox-empty p { max-width: 440px; margin: 0 auto; color: var(--email-muted); font-size: 12px; line-height: 1.8; }
#emailPanel .email-inbox-empty button { margin-top: 16px; }
#emailPanel .email-loading { padding: 28px 16px; text-align: center; font-size: 13px; color: var(--email-muted); }
@media (max-width: 900px) {
 #emailPanel .email-human-check { display: none; }
 #emailPanel .email-setup-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 #emailPanel .email-settings-form { grid-template-columns: 130px minmax(0, 1fr); }
 #emailPanel .email-settings-form > button { grid-column: 1 / -1; justify-self: start; }
 #emailPanel .email-event-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
 #emailPanel { padding: 16px; }
 #emailPanel .email-workspace-heading { margin-bottom: 18px; }
 #emailPanel .email-workspace-title { align-items: flex-start; gap: 10px; }
 #emailPanel .email-workspace-icon { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
 #emailPanel .email-workspace-icon svg { width: 21px; height: 21px; }
 #emailPanel .email-workspace-heading h2 { font-size: 20px; }
 #emailPanel .email-workspace-heading p { font-size: 12px; }
 #emailPanel #emailSettings { padding: 15px 14px 0; margin-bottom: 22px; }
 #emailPanel .email-setup-guide > summary { align-items: flex-start; flex-direction: column; gap: 3px; }
 #emailPanel .email-setup-guide > summary::after { top: 14px; }
 #emailPanel .email-settings-form, #emailPanel .email-settings-card .email-settings-form { grid-template-columns: minmax(0, 1fr); }
 #emailPanel .email-settings-form > button { width: 100%; }
 #emailPanel .email-settings-route { flex-wrap: wrap; gap: 10px; padding: 11px; }
 #emailPanel .email-settings-route code { font-size: 12px; }
 #emailPanel .email-provider-guides { grid-template-columns: minmax(0, 1fr); }
 #emailPanel .email-inbox-title { gap: 6px; }
 #emailPanel .email-inbox-title h2 { font-size: 18px; }
 #emailPanel .email-count { font-size: 10px; }
 #emailPanel .email-inbox-heading > button { padding: 7px 9px; font-size: 11px; }
 #emailPanel .email-event { padding: 15px; }
 #emailPanel .email-event.pending { padding-top: 13px; }
 #emailPanel .email-event-heading { gap: 8px; }
 #emailPanel .email-event-heading h3 { font-size: 20px; }
 #emailPanel .email-match-block { padding: 12px; }
 #emailPanel .email-event-actions { align-items: stretch; flex-direction: column; gap: 9px; }
 #emailPanel .email-event-buttons { display: grid; grid-template-columns: auto minmax(0, 1fr); margin: 0; }
 #emailPanel .email-event-buttons button { padding-inline: 10px; }
}
@media (max-width: 400px) {
 #emailPanel { padding: 12px; }
 #emailPanel .email-workspace-icon { display: none; }
 #emailPanel .email-workspace-heading h2 { font-size: 19px; }
 #emailPanel .email-event-fields, #emailPanel .email-setup-steps { grid-template-columns: minmax(0, 1fr); }
 #emailPanel .email-inbox-title { align-items: flex-start; flex-direction: column; }
 #emailPanel .email-event { padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) { #emailPanel button { transition: none; } }
