/* 2Day Beta 2 invitation-quality corrections.
   Keep existing responsive navigation and user-selected typography/theme. */

/* Narrow DESKTOP browsers retain desktop text-size settings. The mobile
   layout can still collapse the source navigation at its existing breakpoint. */
html[data-device-category="mobile"] body[data-font-device="desktop"][data-text-size="small"] {
  --mobile-title-size:13px;--mobile-body-size:12px;--mobile-ai-size:12px;
  --mobile-ui-size:12px;--mobile-meta-size:11px;
}
html[data-device-category="mobile"] body[data-font-device="desktop"][data-text-size="standard"] {
  --mobile-title-size:15px;--mobile-body-size:13px;--mobile-ai-size:13px;
  --mobile-ui-size:13px;--mobile-meta-size:11px;
}
html[data-device-category="mobile"] body[data-font-device="desktop"][data-text-size="large"] {
  --mobile-title-size:18px;--mobile-body-size:16px;--mobile-ai-size:16px;
  --mobile-ui-size:15px;--mobile-meta-size:12px;
}
html[data-device-category="mobile"] body[data-font-device="desktop"] #dashboard .story-title-trigger {
  font-size:var(--mobile-title-size)!important;
}
html[data-device-category="mobile"] body[data-font-device="desktop"] #dashboard .story-desc-text {
  font-size:var(--mobile-body-size)!important;
}
html[data-device-category="mobile"] body[data-font-device="desktop"] #dashboard .analysis-result,
html[data-device-category="mobile"] body[data-font-device="desktop"] #dashboard .analysis-result .answer {
  font-size:var(--mobile-ai-size)!important;
}

/* Never substitute a blank-screen flash for an actual theme fix. */
html.theme-dark { color-scheme:dark; background-color:#0B1120; }
html.theme-light { color-scheme:light; background-color:#F8FAFC; }

/* First-login zero-source publisher catalog. No subscription is written
   unless an explicit feed is selected in the existing Add Source dialog. */
#dashboard .d2-beta2-starter {display:block;box-sizing:border-box;width:min(100%,870px);
 margin:18px auto 24px;padding:22px;border:1px solid var(--d2-stroke,#D6E1EC);
 border-radius:14px;background:var(--d2-p2-unread,#fff);color:var(--d2-ink,#0D2A45)}
#dashboard .d2-beta2-starter.hidden {display:none!important}
#dashboard .d2-beta2-starter h2 {margin:0 0 6px;font-size:22px;line-height:1.3;font-weight:700;color:inherit}
#dashboard .d2-beta2-starter p {margin:0 0 18px;font-size:14px;line-height:1.5;color:inherit;opacity:.84}
#dashboard .d2-beta2-starter-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
#dashboard .d2-beta2-starter-tile {box-sizing:border-box;display:flex;align-items:center;
 gap:10px;min-width:0;min-height:60px;padding:10px 12px;text-align:left;
 border:1px solid var(--d2-stroke,#D6E1EC);border-radius:10px;
 background:transparent;color:inherit;cursor:pointer;font:inherit}
#dashboard .d2-beta2-starter-tile:hover {border-color:#E39639;background:rgba(227,150,57,.09)}
#dashboard .d2-beta2-starter-tile:focus-visible {outline:3px solid #E39639;outline-offset:2px}
#dashboard .d2-beta2-starter-tile img,
#dashboard .d2-beta2-starter-fallback {flex:0 0 46px;width:46px;height:30px;object-fit:contain;border-radius:6px}
#dashboard .d2-beta2-starter-fallback {display:none;place-items:center;font-weight:800;
 background:rgba(227,150,57,.15);color:inherit}
#dashboard .d2-beta2-starter-tile img[hidden]+.d2-beta2-starter-fallback {display:grid}
#dashboard .d2-beta2-starter-tile span.d2-beta2-starter-name {min-width:0;overflow-wrap:anywhere;
 font-size:14px;font-weight:650;line-height:1.25}
#dashboard .d2-beta2-starter-footer {margin-top:16px;font-size:13px}
#dashboard .d2-beta2-starter-footer button {border:0;background:transparent;color:#C17B24;
 text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:5px 0;font:inherit;font-weight:650}
#dashboard .d2-ux-refreshing {min-height:28px;}
@media(max-width:800px){
 #dashboard .d2-beta2-starter-grid {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:520px){
 #dashboard .d2-beta2-starter{margin:14px 8px 20px;padding:16px}
 #dashboard .d2-beta2-starter h2{font-size:19px}
 #dashboard .d2-beta2-starter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #dashboard .d2-beta2-starter-tile{padding:8px;min-height:58px;gap:8px}
 #dashboard .d2-beta2-starter-tile span.d2-beta2-starter-name{font-size:13px}
}
@media(prefers-reduced-motion:reduce){
 #dashboard .d2-beta2-starter-tile {transition:none!important}
}

/* QF37: activity reflects only items retrieved from the feed. */
body .source-discovery-item .d2-beta2-feed-activity,
body .source-discovery-item .d2-beta2-feed-activity-note {
  display:block;max-width:100%;overflow-wrap:anywhere;line-height:1.35;
}
body .source-discovery-item .d2-beta2-feed-activity {
  margin-top:5px;font-size:12px;font-weight:600;opacity:.86;
}
body .source-discovery-item .d2-beta2-feed-activity[data-activity-status="stale"] {
  color:#B66B23;
}
body .source-discovery-item .d2-beta2-feed-activity-note {
  margin-top:3px;font-size:10px;opacity:.68;
}

/* QF19 final desktop-width fix: legacy v17 desktop tablet CSS reintroduces
   an 18px headline at ~1100px, even when the physical DESKTOP preference is
   Small or Standard. Two IDs win over historical !important media rules.
   This scopes only desktop/tablet preferences; actual phone preferences keep
   their independent chosen mobile typography. */
html body[data-font-device="desktop"][data-text-size="small"] #dashboard #desktopNewsContainer .story-title-trigger,
html body[data-font-device="desktop"][data-text-size="small"] #dashboard #newsBody .story-title-trigger {font-size:13px!important}
html body[data-font-device="desktop"][data-text-size="standard"] #dashboard #desktopNewsContainer .story-title-trigger,
html body[data-font-device="desktop"][data-text-size="standard"] #dashboard #newsBody .story-title-trigger {font-size:15px!important}
html body[data-font-device="desktop"][data-text-size="large"] #dashboard #desktopNewsContainer .story-title-trigger,
html body[data-font-device="desktop"][data-text-size="large"] #dashboard #newsBody .story-title-trigger {font-size:18px!important}
html body[data-font-device="desktop"][data-text-size="small"] #dashboard #desktopNewsContainer .story-desc-text,
html body[data-font-device="desktop"][data-text-size="small"] #dashboard #newsBody .story-desc-text {font-size:12px!important}
html body[data-font-device="desktop"][data-text-size="standard"] #dashboard #desktopNewsContainer .story-desc-text,
html body[data-font-device="desktop"][data-text-size="standard"] #dashboard #newsBody .story-desc-text {font-size:13px!important}
html body[data-font-device="desktop"][data-text-size="large"] #dashboard #desktopNewsContainer .story-desc-text,
html body[data-font-device="desktop"][data-text-size="large"] #dashboard #newsBody .story-desc-text {font-size:16px!important}


/* QF17 physical iPhone Safari: first-use instructions must clear the
   fixed mobile header, like the already accepted empty-Saved panel. */
@media(max-width:900px){
  html[data-device-category="mobile"] body.headerless-concept #dashboard #d2Beta2SourceStarter:not(.hidden){
    margin-top:calc(64px + env(safe-area-inset-top, 0px))!important;
    scroll-margin-top:calc(70px + env(safe-area-inset-top, 0px));
  }
}
/* QF17: reuse the existing Add-source input/search presentation inline
   instead of a bare underlined link. The form always routes via the
   existing validated Add modal, never subscribes directly. */
#dashboard .d2-beta2-starter-footer form{display:block;margin:0}
#dashboard .d2-beta2-starter-footer label{display:block;font-size:13px;line-height:1.4;font-weight:650;margin-bottom:7px}
#dashboard .d2-beta2-other-input-row{display:flex;gap:9px;align-items:stretch;min-width:0}
#dashboard .d2-beta2-other-input-row input{
  flex:1 1 0;min-width:0;min-height:42px;box-sizing:border-box;
  padding:8px 11px;border-radius:8px;border:1px solid var(--d2-stroke,#D6E1EC);
  background:var(--d2-p2-unread,#fff);color:inherit;font:inherit;font-size:14px
}
#dashboard .d2-beta2-other-input-row button{
  flex:0 0 auto;min-height:42px;padding:8px 16px;border-radius:8px;
  border:1px solid #315EDB;background:#315EDB;color:#fff;
  font-size:14px;font-weight:650;text-decoration:none;cursor:pointer
}
#dashboard .d2-beta2-other-input-row :is(input,button):focus-visible{outline:2px solid #F59E0B;outline-offset:2px}
@media(max-width:520px){
  #dashboard .d2-beta2-other-input-row{flex-direction:column}
  #dashboard .d2-beta2-other-input-row button{width:100%}
}
/* QF37: force a real compact grid on Mac Safari: checkbox + favicon +
   editable name in the SAME top row, then URL and concise counts. */
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-item{
  display:grid!important;grid-template-columns:20px 24px minmax(0,1fr)!important;
  align-items:start!important;gap:6px!important;padding:7px 9px!important
}
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-checkbox{grid-column:1;grid-row:1;margin-top:6px!important}
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-favicon-wrap{grid-column:2;grid-row:1;margin-top:4px!important}
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-main{
  grid-column:3;grid-row:1;min-width:0!important;width:100%!important;
  display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:2px!important
}
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-name-input{
  max-width:none!important;width:100%!important;box-sizing:border-box!important
}
body > .d2-ux-dialog #sourceDiscoveryList .source-discovery-url{margin-top:0!important}
body > .d2-ux-dialog #sourceDiscoveryList .d2-beta2-feed-activity{margin-top:2px;font-size:12px}
