/* ── Home dashboard ── */
.home-container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}


/* Greeting — reuse chat empty state styles */
.home-container .empty-state-hero { padding-top: 48px; }
.home-container .empty-state-greeting h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* Compose bar */
.home-compose {
  margin: 24px 0 28px;
}
.home-compose form {
  position: relative;
}
.home-compose-box {
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 24px;
  background: var(--color-card);
  transition: border-color 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.home-compose-box:focus-within {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(20,70,41,0.08);
}
.home-compose-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 13px 48px 13px 8px;
  border: none;
  font-size: 15px;
  line-height: 1.45;
  font-family: inherit;
  background: transparent;
  color: var(--color-text-primary);
  outline: none;
  resize: none;
  overflow-y: auto;
  min-height: 46px;
  max-height: 200px;
  scrollbar-width: none;
}
.home-compose-input::-webkit-scrollbar {
  display: none;
}
.home-compose-input::placeholder { color: var(--color-text-muted); }
.home-compose-row {
  display: flex;
  align-items: flex-start;
}
.home-compose-clip {
  flex-shrink: 0;
  color: var(--color-text-muted);
  display: flex;
  cursor: pointer;
  background: none;
  border: none;
  padding: 14px 0 14px 14px;
}
.home-compose-clip:hover { color: var(--color-text-primary); }
.home-compose-clip svg { width: 18px; height: 18px; }
.home-file-previews:empty { display: none; }
.home-file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.home-compose-send {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s;
}
.home-compose-send:hover { background: var(--color-brand-hover); }
.home-compose-send svg { width: 16px; height: 16px; }

/* Screener — Hey-style attention items */
@keyframes screener-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.home-screener {
  margin-bottom: 28px;
}
.home-screener-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.home-screener-count {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-screener-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.home-screener-see-all {
  margin-left: auto;
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.12s;
}
.home-screener-see-all:hover { color: var(--color-text-secondary); }

/* Card deck */
.approval-deck {
  position: relative;
  margin-top: 4px;
  padding-bottom: 16px;
}
.approval-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-card);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  pointer-events: none;
  user-select: none;
}
.approval-card-active {
  position: relative;
  pointer-events: auto;
  user-select: auto;
}
.approval-card-body { margin-bottom: 16px; }
.approval-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}
.approval-card-detail {
  font-size: 13.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.approval-card-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}
.approval-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.approval-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.12s, background 0.12s, box-shadow 0.12s;
  text-decoration: none;
}
.approval-btn:active { transform: scale(0.96); }
.approval-btn svg { width: 15px; height: 15px; }

.approval-btn-approve {
  background: var(--color-brand);
  color: #fff;
}
.approval-btn-approve:hover {
  background: var(--color-brand-hover);
  box-shadow: 0 2px 8px rgba(20,70,41,0.2);
}

.approval-btn-deny {
  background: var(--color-hover);
  color: var(--color-text-muted);
}
.approval-btn-deny:hover {
  background: rgba(239,68,68,0.08);
  color: #dc2626;
}

.approval-btn-open {
  margin-left: auto;
  background: none;
  color: var(--color-text-muted);
  padding: 7px 12px;
}
.approval-btn-open:hover { color: var(--color-text-secondary); }
.approval-btn-open svg { width: 14px; height: 14px; }

/* All caught up state */
@keyframes check-circle-draw {
  0% { stroke-dashoffset: 63; }
  100% { stroke-dashoffset: 0; }
}
@keyframes check-tick-draw {
  0% { stroke-dashoffset: 12; }
  100% { stroke-dashoffset: 0; }
}
@keyframes caught-up-text {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes screener-fade-out {
  0%   { opacity: 1; max-height: 200px; margin-bottom: 28px; }
  70%  { opacity: 1; max-height: 200px; margin-bottom: 28px; }
  85%  { opacity: 0.6; max-height: 100px; margin-bottom: 14px; }
  100% { opacity: 0; max-height: 0; margin-bottom: 0; overflow: hidden; }
}

.approval-deck-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 0;
}
.approval-deck-empty svg {
  color: #079455;
  width: 32px;
  height: 32px;
}
.approval-deck-empty svg circle {
  stroke-dasharray: 63;
  stroke-dashoffset: 63;
  animation: check-circle-draw 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards;
}
.approval-deck-empty svg polyline {
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
  animation: check-tick-draw 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.8s forwards;
}
.approval-deck-empty span {
  font-family: 'Caveat', cursive;
  font-size: 22px;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  animation: caught-up-text 0.4s ease 1s backwards;
}
.home-screener.screener-clearing {
  animation: screener-fade-out 5s ease forwards;
}

/* Dashboard grid */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  grid-template-rows: auto auto;
  gap: 16px;
  margin-bottom: 48px;
}

.home-card {
  background: var(--color-card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.03);
  transition: box-shadow 0.2s;
}
.home-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04); }
.home-card-digest { grid-row: 1 / 3; }

.home-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.home-card-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.home-card-icon svg { width: 18px; height: 18px; stroke-width: 1.5; }

.home-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
}
.home-card-subtitle {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-left: auto;
}

/* Clickable card headers */
a.home-card-header-link {
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  margin: -8px -8px 12px;
  padding: 8px;
  transition: background 0.15s;
}
a.home-card-header-link:hover { background: var(--color-hover); }
.home-card-chevron {
  width: 0;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  opacity: 0;
  overflow: hidden;
  transition: width 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.15s;
}
.home-card-chevron svg { width: 14px; height: 14px; flex-shrink: 0; }
a.home-card-header-link:hover .home-card-chevron { width: 20px; opacity: 1; }

.home-card-body { font-size: 14px; line-height: 1.6; color: var(--color-text-secondary); }

/* Structured digest */
.digest-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.digest-updated {
  font-size: 12px;
  font-weight: 300;
  color: var(--color-text-muted);
}
.digest-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}
.digest-refresh-btn:hover {
  background: var(--color-hover);
  color: var(--color-text-secondary);
}
.digest-refresh-btn svg { width: 14px; height: 14px; }
@keyframes digest-spin {
  to { transform: rotate(360deg); }
}
.digest-refresh-btn.spinning svg {
  animation: digest-spin 0.8s linear infinite;
}
turbo-frame#digest-content[busy] .digest-meta-row,
turbo-frame#digest-content[busy] .digest-headline,
turbo-frame#digest-content[busy] .digest-items,
turbo-frame#digest-content[busy] .home-card-body {
  opacity: 0.3;
  transition: opacity 0.2s;
}

.digest-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.45;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.digest-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.digest-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
}
a.digest-item-link {
  text-decoration: none;
  color: inherit;
  margin: 0 -8px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
a.digest-item-link:hover { background: var(--color-hover); }
.digest-item-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-text-muted);
}
.digest-item-icon svg { width: 14px; height: 14px; stroke-width: 1.5; }

.digest-item-body {
  flex: 1;
  min-width: 0;
}
.digest-item-text {
  font-size: 14px;
  color: var(--color-text-primary);
  line-height: 1.45;
  display: block;
}
.digest-item-detail {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.digest-skeleton { padding: 4px 0; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line-wide { width: 85%; }
.skeleton-line-long { width: 70%; }
.skeleton-line-med { width: 55%; }
.skeleton-line-short { width: 40%; }
.skeleton-spacer { height: 20px; }
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.skeleton-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.home-digest-text { margin: 0; }
.home-digest-text strong { color: var(--color-text-primary); font-weight: 600; }

/* In-flight tasks in digest card */
.home-inflight-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.04);
}
.home-inflight-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.home-inflight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.home-inflight-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.home-inflight-dot.running {
  background: #079455;
  animation: home-pulse 2s ease-in-out infinite;
}
.home-inflight-dot.pending { background: rgba(0,0,0,0.15); }
@keyframes home-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.home-inflight-text {
  font-size: 13px;
  color: var(--color-text-primary);
}

/* ── Shell pages ── */
.home-page {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
}
.home-page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 6px;
}
.home-page-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0 0 24px;
}

.home-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-flight-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-flight-body { flex: 1; }
.home-flight-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}
.home-flight-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.home-flight-meta a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,0.15);
}

/* ── Actions / Integrations overview grid ── */
.actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.actions-summary-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: block;
}
.actions-summary-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
}
.actions-summary-card-wide {
  grid-column: 1 / -1;
}

.actions-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.actions-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.actions-summary-icon svg { width: 14px; height: 14px; }
.asi-flight { background: rgba(247,144,9,0.08); color: #b45309; }
.asi-suggested { background: rgba(20,70,41,0.08); color: var(--color-brand); }
.asi-scheduled { background: rgba(168,85,247,0.08); color: #a855f7; }
.asi-connected { background: rgba(7,148,85,0.08); color: #079455; }
.asi-available { background: rgba(59,130,246,0.08); color: #3b82f6; }

.actions-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.actions-summary-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-hover);
}

.actions-summary-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.actions-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.actions-summary-row-text {
  color: var(--color-text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.actions-summary-row-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.actions-summary-more {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.actions-summary-empty {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.integration-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.integration-status-dot.connected { background: #079455; }

/* ── Calendar items ── */
.home-cal-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}
a.home-cal-item-link {
  text-decoration: none;
  color: inherit;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
a.home-cal-item-link:hover { background: var(--color-hover); }
.home-cal-item + .home-cal-item {
  border-top: 1px solid rgba(0,0,0,0.03);
}
a.home-cal-item-link + a.home-cal-item-link { border-top: none; }
.home-cal-time {
  font-size: 12px;
  font-weight: 300;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.home-cal-detail { flex: 1; min-width: 0; }
.home-cal-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
}
.home-cal-meta {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Email items ── */
.home-email-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
}
a.home-email-item-link {
  text-decoration: none;
  color: inherit;
  margin: 0 -8px;
  padding: 10px 8px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: pointer;
}
a.home-email-item-link:hover { background: var(--color-hover); }
.home-email-item + .home-email-item {
  border-top: 1px solid rgba(0,0,0,0.03);
}
a.home-email-item-link + a.home-email-item-link { border-top: none; }
.home-email-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
  margin-top: 7px;
}
.home-email-item:not(.home-email-unread) .home-email-dot {
  display: none;
}
.home-email-body { flex: 1; min-width: 0; }
.home-email-sender {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.home-email-subject {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.home-email-time {
  font-size: 12px;
  font-weight: 300;
  color: var(--color-text-muted);
  flex-shrink: 0;
  padding-top: 2px;
}

/* ── Digest page sections ── */
.home-page-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.digest-section {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}
.digest-section:last-child { border-bottom: none; }
/* ── Suggestion cards ── */
.suggestion-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.suggestion-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.1);
}
.suggestion-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.suggestion-source {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.ss-email { background: rgba(59,130,246,0.08); color: #3b82f6; }
.ss-calendar { background: rgba(168,85,247,0.08); color: #a855f7; }
.ss-pattern { background: rgba(234,179,8,0.08); color: #ca8a04; }
.ss-room { background: rgba(75,53,194,0.08); color: #4B35C2; }
.suggestion-confidence {
  margin-left: auto;
  font-size: 11px;
  color: var(--color-text-muted);
}
.suggestion-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}
.suggestion-reason {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}
.suggestion-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-start {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: var(--color-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-start:hover { background: var(--color-brand-hover); }
.btn-dismiss {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.12s;
}
.btn-dismiss:hover { color: var(--color-text-secondary); }

.digest-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

/* ── Priority surface ── */
.priority-container {
  margin-bottom: 48px;
}
.priority-skeleton {
  padding: 4px 0;
}

.priority-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.priority-updated {
  font-size: 12px;
  font-weight: 300;
  color: var(--color-text-muted);
}
.priority-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.priority-refresh-btn:hover {
  background: var(--color-hover);
  color: var(--color-text-secondary);
}
.priority-refresh-btn svg { width: 14px; height: 14px; }
.priority-refresh-btn.spinning svg {
  animation: digest-spin 0.8s linear infinite;
}
turbo-frame#priority-content[busy] .priority-meta-row,
turbo-frame#priority-content[busy] .priority-headline,
turbo-frame#priority-content[busy] .priority-section {
  opacity: 0.3;
  transition: opacity 0.2s;
}

.priority-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.45;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.priority-section {
  margin-bottom: 20px;
}
.priority-section:last-child {
  margin-bottom: 0;
}
.priority-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.priority-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.priority-section-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-hover);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 5px;
}

.priority-section-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

a.priority-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
  cursor: pointer;
}
a.priority-item:hover {
  background: var(--color-hover);
}

.priority-item-source {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.priority-item-source svg {
  width: 16px;
  height: 16px;
}
.priority-source-gmail,
.priority-source-google_calendar,
.priority-source-tasks,
.priority-source-conversations,
.priority-source-github { color: var(--color-text-muted); }

.priority-item-body {
  flex: 1;
  min-width: 0;
}
.priority-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.4;
}
.priority-item-detail {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.priority-item-pinned {
  background: var(--color-brand-subtle);
}
.priority-pinned-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-brand);
  background: var(--color-brand-subtle);
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.priority-quick-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-brand);
  border: 1px dashed var(--color-border);
  border-radius: 14px;
  transition: all 0.15s;
}
a.priority-item:hover .priority-quick-action {
  border-style: solid;
  border-color: var(--color-brand);
  background: var(--color-brand-subtle);
}
.priority-quick-action svg { flex-shrink: 0; }

/* Item actions — hover reveal */
.priority-item-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.priority-pin-toggle,
.priority-dismiss-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
  color: var(--color-text-muted);
}
.priority-pin-toggle svg,
.priority-dismiss-btn svg {
  width: 14px;
  height: 14px;
}
a.priority-item:hover .priority-pin-toggle,
a.priority-item:hover .priority-dismiss-btn {
  opacity: 1;
  pointer-events: auto;
}
.priority-pin-toggle:hover {
  background: rgba(20,70,41,0.08);
  color: var(--color-brand);
}
.priority-dismiss-btn:hover {
  background: rgba(239,68,68,0.06);
  color: #dc2626;
}
.priority-pin-active {
  opacity: 1;
  pointer-events: auto;
  color: var(--color-brand);
}
.priority-pin-active:hover {
  color: var(--color-text-muted);
}

/* ── Preview modal ── */
.home-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.home-preview-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.home-preview-card {
  background: var(--color-card);
  border-radius: 20px;
  padding: 0;
  width: 480px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
}
.hp-sidebar { display: none; }
.hp-main { padding: 22px 24px 16px; border-radius: 20px 20px 0 0; }
.hp-footer {
  padding: 14px 24px 20px;
  background: linear-gradient(to bottom, transparent 0%, rgba(20,70,41,0.06) 100%);
  border-radius: 0 0 20px 20px;
}

/* Type-specific background tints */
.home-preview-card::before { display: none; }
.home-preview-card.hp-calendar .hp-main {
  background: var(--color-card);
}
.home-preview-card.hp-email .hp-main {
  background: var(--color-card);
}
.home-preview-card.hp-digest .hp-main {
  background: linear-gradient(180deg, rgba(20,70,41,0.06) 0%, var(--color-card) 60%);
}

/* Close button — positioned on the card */
.home-preview-card { position: relative; }
.hp-close {
  position: absolute;
  top: 20px;
  right: 18px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
  z-index: 1;
}
.hp-close svg { width: 16px; height: 16px; }
.hp-close:hover { background: var(--color-hover); color: var(--color-text-primary); }


.home-preview-card {
  box-shadow: 0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  transform: scale(0.92) translateY(8px);
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.18s ease;
  opacity: 0;
}
.home-preview-backdrop.active .home-preview-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.home-preview-type {
  display: none !important;
}
.hp-type-calendar { background: rgba(168,85,247,0.08); color: #a855f7; }
.hp-type-email { background: rgba(59,130,246,0.08); color: #3b82f6; }
.hp-type-digest { background: rgba(20,70,41,0.08); color: var(--color-brand); }

.home-preview-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.35;
  margin-bottom: 4px;
}
.home-preview-detail {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.home-preview-body {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  padding: 14px 20px 14px 16px;
  background: var(--color-hover);
  border-radius: 12px;
  margin-bottom: 16px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.home-preview-body.loading {
  opacity: 0.5;
}

.home-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.home-preview-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  background: rgba(225,235,228,0.5);
  color: #17693a;
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.home-preview-chip:hover {
  background: rgba(210,228,215,0.7);
  box-shadow: 0 1px 4px rgba(20,70,41,0.08);
}

/* Email preview — hey.com-inspired layout */
.home-preview-card.hp-email {
  width: 640px;
  max-width: calc(100vw - 48px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-preview-card.hp-email .hp-main {
  padding: 28px 32px 24px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.home-preview-card.hp-email .hp-footer {
  padding: 12px 32px 20px;
  flex-shrink: 0;
}
.home-preview-card.hp-email .hp-close {
  top: 20px;
  right: 20px;
}
.home-preview-card.hp-email::before {
  display: none;
}

.hp-email-body {
  background: none;
  padding: 0;
  max-height: none;
  overflow: visible;
  margin-bottom: 16px;
  white-space: normal;
}
.hp-email-subject {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.3;
  margin-bottom: 16px;
  padding-right: 32px;
}
.hp-email-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.hp-email-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-brand, #144629);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hp-email-meta {
  flex: 1;
  min-width: 0;
}
.hp-email-from-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.hp-email-sender-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.hp-email-sender-addr {
  font-size: 12px;
  color: var(--color-text-muted);
}
.hp-email-to-row {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.hp-email-date {
  font-size: 12px;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.hp-email-content {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.hp-email-iframe {
  width: 100%;
  border: none;
  min-height: 80px;
  border-radius: 4px;
}
/* Email skeleton loading state */
.hp-email-skeleton { white-space: normal; }
.hp-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.hp-skel-subject {
  margin-bottom: 18px;
}
.hp-skel-subject .hp-skel-line {
  height: 18px;
  border-radius: 8px;
}
.hp-skel-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 20px;
}
.hp-skel-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.hp-skel-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}
.hp-skel-short { height: 10px; }
.hp-skel-date { flex-shrink: 0; height: 10px; margin-top: 2px; }
.hp-skel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hp-email-img-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: rgba(0,0,0,0.03);
  font-size: 12px;
  color: var(--color-text-muted);
}
.hp-email-img-banner button {
  background: none;
  border: none;
  color: var(--color-brand, #144629);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.hp-email-img-banner button:hover { text-decoration: underline; }
.hp-email-loading {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
}
.hp-email-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.hp-email-attach-card {
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.hp-email-attach-card:hover {
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.hp-email-attach-image {
  width: calc(50% - 4px);
  min-width: 140px;
}
.hp-email-attach-thumb {
  background: var(--color-hover, #f8f8f8);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  overflow: hidden;
}
.hp-email-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hp-email-attach-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.hp-email-attach-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
}
.hp-email-attach-icon svg { width: 100%; height: 100%; }
.hp-email-attach-name {
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hp-email-attach-file .hp-email-attach-name {
  padding: 0;
}

/* Thread view */
.hp-thread-count {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.hp-thread-msg {
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 16px;
  margin-top: 4px;
}
.hp-thread-msg .hp-email-header {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.hp-thread-msg:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.hp-thread-msg-body {
  margin-top: 16px;
}
.hp-thread-msg-collapsed .hp-thread-msg-body {
  display: none;
}
.hp-thread-msg-collapsed .hp-email-header {
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 0;
  cursor: pointer;
}
.hp-thread-msg-collapsed .hp-email-header:hover {
  background: rgba(0,0,0,0.02);
  border-radius: 8px;
  margin: -4px -8px;
  padding: 4px 8px;
}
.hp-thread-snippet {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.hp-thread-toggle {
  cursor: pointer;
}

/* Calendar preview body — GCal icon rows */
.hp-cal-body {
  background: none;
  padding: 0;
  max-height: none;
  overflow: visible;
}
.hp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.hp-row > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.hp-row.hp-row-top { align-items: flex-start; }
.hp-row.hp-row-top > svg { margin-top: 2px; }
.hp-desc-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  white-space: pre-wrap;
}
.hp-link-text {
  font-size: 13px;
  color: var(--color-brand);
  text-decoration: none;
  transition: opacity 0.12s;
}
.hp-link-text:hover { opacity: 0.8; }
/* Guest list — GCal style */
.hp-guest-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}
.hp-guest-count {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}
.hp-guest {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 0 3px 4px;
}
.hp-guest-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.hp-guest-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.hp-guest-org {
  font-weight: 400;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: 4px;
}
.hp-rsvp {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.hp-rsvp-yes { color: #079455; }
.hp-rsvp-no { color: #dc2626; }
.hp-rsvp-maybe { color: #ca8a04; }
.hp-rsvp-pending { color: var(--color-text-muted); opacity: 0.4; }
.hp-guest-email {
  font-size: 11px;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar shimmer loading */
.hp-sidebar-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0;
}
.hp-sidebar-shimmer {
  height: 10px;
  width: 80%;
  border-radius: 5px;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.hp-sidebar-shimmer.short { width: 55%; }

/* Sidebar widgets */
.hp-widget {
  margin-bottom: 2px;
}
.hp-widget-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.hp-widget-toggle::-webkit-details-marker { display: none; }
.hp-widget-toggle::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid var(--color-text-muted);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.hp-widget[open] > .hp-widget-toggle::before {
  transform: rotate(90deg);
}
.hp-widget-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-hover);
  padding: 0 5px;
  border-radius: 6px;
  line-height: 1.5;
}
.hp-widget-body {
  padding: 0 0 4px 8px;
}

/* Context rows inside widgets */
.hp-context-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 11px;
}
.hp-context-date {
  width: 40px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 300;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.hp-context-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}
.hp-context-text {
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.home-preview-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.home-preview-input {
  width: 100%;
  padding: 10px 14px;
  min-height: 60px;
  border: 1px solid rgba(20,70,41,0.12);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--color-card);
  color: var(--color-text-primary);
  outline: none;
  box-sizing: border-box;
  resize: none;
  line-height: 1.45;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-preview-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(20,70,41,0.08);
}

.home-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.home-preview-btn-cancel {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.home-preview-btn-cancel:hover {
  color: var(--color-text-secondary);
  background: var(--color-hover);
}
.home-preview-btn-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: var(--color-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.home-preview-btn-go:hover { background: var(--color-brand-hover); }
.home-preview-btn-go:active { transform: scale(0.97); }
.home-preview-btn-go svg { flex-shrink: 0; }

/* ── Priority detail modal ── */
.home-preview-card.hp-priority {
  width: 700px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-preview-card.hp-priority .hp-main {
  display: flex;
  flex-direction: column;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.home-preview-card.hp-priority .hp-footer {
  padding: 12px 28px 20px;
  flex-shrink: 0;
}
.home-preview-card.hp-priority .hp-close {
  top: 14px;
  right: 16px;
  z-index: 2;
}

.hp-priority-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.hp-priority-header .hp-priority-title {
  flex: 1;
  text-align: center;
  margin: 0;
  padding: 0 28px;
}

.hp-priority-primary {
  padding: 20px 28px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}
.hp-priority-sidebar {
  padding: 0 28px 20px;
  border-top: 1px solid rgba(0,0,0,0.06);
  margin-top: 4px;
  padding-top: 16px;
}

.hp-priority-back {
  display: inline-flex;
  align-items: center;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
}
.hp-priority-back:hover { color: var(--color-text-primary); background: var(--color-hover); }

.hp-priority-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.hp-priority-title-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.hp-priority-title-link svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity 0.12s;
}
.hp-priority-title-link:hover svg { opacity: 1; }
.hp-priority-title-link:hover { color: var(--color-brand); }
.hp-priority-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.hp-priority-source-badge svg {
  width: 12px;
  height: 12px;
}
.hp-priority-source-gmail,
.hp-priority-source-google_calendar,
.hp-priority-source-tasks,
.hp-priority-source-conversations,
.hp-priority-source-github {
  background: rgba(0,0,0,0.04);
  color: var(--color-text-muted);
}

.hp-priority-detail {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.hp-priority-section {
  margin-bottom: 20px;
}
.hp-priority-section:last-child {
  margin-bottom: 0;
}
.hp-priority-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* Task metadata */
.hp-priority-task-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hp-priority-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-priority-task-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 72px;
  flex-shrink: 0;
}
.hp-priority-task-value {
  font-size: 13px;
  color: var(--color-text-primary);
}
.hp-priority-task-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 4px;
}
.hp-priority-subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--color-text-primary);
}
.hp-priority-subtask-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hp-priority-subtask-dot.completed { background: #079455; }
.hp-priority-subtask-dot.pending { background: rgba(0,0,0,0.15); }
.hp-priority-subtask-dot.in_progress { background: #3b82f6; }

/* Email thread messages in priority modal */
.hp-priority-thread-msg {
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.hp-priority-thread-msg:first-child {
  border-top: none;
  padding-top: 0;
}
.hp-priority-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.hp-priority-msg-from {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
}
.hp-priority-msg-date {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-left: auto;
}
.hp-priority-msg-body {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.hp-priority-msg-toggle {
  font-size: 12px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: 6px 0;
  cursor: pointer;
  font-family: inherit;
}
.hp-priority-msg-toggle:hover { color: var(--color-text-secondary); }

/* Calendar event details */
.hp-priority-event-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.hp-priority-event-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  margin-top: 1px;
}

/* Related item cards */
.hp-priority-section-items-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hp-priority-related-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  transition: background 0.12s, border-color 0.12s;
  max-width: 280px;
}
.hp-priority-related-card:hover {
  background: var(--color-hover);
  border-color: rgba(0,0,0,0.15);
}
.hp-priority-related-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text-muted);
}
.hp-priority-related-icon svg { width: 100%; height: 100%; }
.hp-priority-related-body {
  flex: 1;
  min-width: 0;
}
.hp-priority-related-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-priority-related-snippet {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Suggested action chips */
.hp-priority-actions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hp-priority-action-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  background: rgba(225,235,228,0.5);
  color: #17693a;
  border: none;
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}
.hp-priority-action-btn:hover {
  background: rgba(210,228,215,0.7);
  box-shadow: 0 1px 4px rgba(20,70,41,0.08);
}

/* Loading skeleton for priority sections */
.hp-priority-skel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hp-priority-skel-line {
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(90deg, #eee 25%, #e0e0e0 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.hp-priority-skel-line.w80 { width: 80%; }
.hp-priority-skel-line.w60 { width: 60%; }
.hp-priority-skel-line.w50 { width: 50%; }
.hp-priority-skel-line.w40 { width: 40%; }
.hp-priority-skel-line.w70 { width: 70%; }

/* Single-column fallback for simple items */
.home-preview-card.hp-priority.hp-priority-simple {
  width: 700px;
}

/* Responsive: single column on narrow screens */
@media (max-width: 700px) {
  .home-preview-card.hp-priority {
    width: calc(100vw - 24px);
  }
  .home-preview-card.hp-priority .hp-main {
    grid-template-columns: 1fr;
  }
  .hp-priority-sidebar {
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding: 20px 28px;
  }
}

/* ── Dark mode ── */
[data-theme="wistful_juniper"],
[data-theme="deep_current"] {
  /* Preview modal card */
  .home-preview-card {
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  }
  .home-preview-backdrop {
    background: rgba(0,0,0,0.55);
  }

  /* Footer gradient */
  .hp-footer {
    background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.02) 100%);
  }

  /* Chips (suggested actions) */
  .home-preview-chip,
  .hp-priority-action-btn {
    background: rgba(255,255,255,0.06);
    color: var(--color-brand);
  }
  .home-preview-chip:hover,
  .hp-priority-action-btn:hover {
    background: rgba(255,255,255,0.1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  }

  /* Input */
  .home-preview-input {
    border-color: rgba(255,255,255,0.1);
  }
  .home-preview-input:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(20,70,41,0.15);
  }

  /* Skeleton loading */
  .hp-priority-skel-line {
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
  }

  /* Related cards */
  .hp-priority-related-card {
    border-color: rgba(255,255,255,0.08);
  }
  .hp-priority-related-card:hover {
    border-color: rgba(255,255,255,0.15);
  }

  /* Thread borders */
  .hp-priority-thread-msg {
    border-color: rgba(255,255,255,0.06);
  }

  /* Email header border */
  .hp-email-header {
    border-color: rgba(255,255,255,0.06);
  }

  /* Subtask dots */
  .hp-priority-subtask-dot.pending {
    background: rgba(255,255,255,0.15);
  }

  /* Priority sidebar border */
  .hp-priority-sidebar {
    border-color: rgba(255,255,255,0.06);
  }

  /* Responsive border */
  @media (max-width: 700px) {
    .hp-priority-sidebar {
      border-top-color: rgba(255,255,255,0.06);
    }
  }
}

