/* 2Day.news v18 integrated post-production usability package.
   Scoped overrides, preserving existing brand, app type-size preferences,
   read tint, and original blue curved selected corner masks. */

body > .d2-ux-backdrop {
  position:fixed !important; inset:0 !important; display:block;
  background:rgba(8,20,34,.36) !important; backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px); z-index:10000 !important;
  border:0 !important; border-radius:0 !important; cursor:default;
}
body > .d2-ux-backdrop.hidden { display:none !important; }
body.d2-ux-modal-active { overflow:hidden !important; }
body > .d2-ux-dialog,
body > #d2SourceManagerPanel.d2-manager-panel:not(.hidden),
html[data-device-category="desktop"] body.headerless-concept #settingsPanel.headerless-settings-drawer:not(.hidden),
html[data-device-category="mobile"] body.headerless-concept #settingsPanel.headerless-settings-drawer:not(.hidden) {
  position:fixed !important; z-index:10002 !important;
  top:50% !important; left:50% !important; bottom:auto !important;
  right:auto !important; transform:translate(-50%,-50%) !important;
  box-sizing:border-box !important; width:min(620px,calc(100vw - 36px)) !important;
  max-width:620px !important; max-height:min(88dvh,820px) !important;
  overflow:auto !important; margin:0 !important;
  padding:20px 24px 24px !important; border-radius:12px !important;
  background:var(--d2-p2-unread,#fff) !important;
  color:var(--d2-ink,#0D2A45) !important;
  border:1px solid var(--d2-stroke,#D6E1EC) !important;
  box-shadow:0 24px 80px rgba(5,16,28,.3) !important;
}
body > .d2-ux-dialog.hidden,
body > #d2SourceManagerPanel.d2-manager-panel.hidden,
body > #settingsPanel.hidden {display:none !important;}
html[data-device-category="desktop"] body.headerless-concept #settingsPanel.headerless-settings-drawer:not(.hidden) {
  display:flex !important;flex-direction:column !important;align-items:stretch !important;
}
#dashboard #d2SourceManagerBackdrop {display:none !important;}
body > .d2-ux-dialog .d2-ux-dialog-header {display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:22px}
body > .d2-ux-dialog .d2-ux-dialog-header h2{font-size:22px;line-height:1.25;font-weight:700;margin:0 0 5px}
body > .d2-ux-dialog .d2-ux-dialog-header p{font-size:14px;line-height:1.45;opacity:.78;margin:0}
body .d2-ux-close,body > .d2-ux-dialog .d2-ux-close {
  display:flex;align-items:center;justify-content:center;flex:0 0 38px;
  height:38px;padding:0;background:transparent;border:0;box-shadow:none;
  border-radius:7px;color:inherit;font-size:28px;font-weight:400;cursor:pointer
}
body > .d2-ux-dialog label{display:block;font-size:14px;font-weight:600;margin-bottom:9px}
body .d2-ux-input-row{display:flex;gap:10px;align-items:stretch;min-width:0}
body #d2UxUrl{flex:1;min-width:0;max-width:none;height:44px;border:1px solid var(--d2-stroke,#D6E1EC);
  border-radius:7px;padding:8px 11px;background:transparent;color:inherit;font:inherit;font-size:15px}
body #d2UxSearch,
body #sourceDiscoveryAddSelected {
  min-height:44px;box-sizing:border-box;display:inline-flex;align-items:center;
  justify-content:center;gap:5px;padding:9px 17px;
  border-radius:7px;font-family:inherit !important;
  font-size:15px !important;line-height:1.3 !important;font-weight:650 !important;
  border:1px solid #315EDB !important;background:#315EDB !important;color:#fff !important;
  box-shadow:none !important;cursor:pointer
}
body #d2UxSearch:disabled,body #sourceDiscoveryAddSelected:disabled{opacity:.55;cursor:wait}
body #d2UxMessage{font-size:14px;line-height:1.45;margin:13px 0;color:inherit}
body #d2UxMessage.d2-ux-error{color:#b13f39}
body #d2UxDiscovery{margin-top:16px}
body #d2UxDiscovery .source-discovery-results{margin:0 !important;padding:0 !important;border:0 !important;box-shadow:none !important;background:transparent !important}
body #d2UxDiscovery .source-discovery-results.hidden{display:none !important}
body #d2UxDiscovery .d2-ux-no-feeds .source-discovery-head,
body #d2UxDiscovery .d2-ux-no-feeds .source-discovery-actions{display:none !important}
body #d2UxDiscovery .source-discovery-empty{padding:12px 0;font-size:15px;line-height:1.5}
body #sourceDiscoveryClear,
body #sourceAddCancelBtn,
body #sourceNameInput{display:none !important}
body #d2UxDiscovery .source-discovery-actions{display:flex;justify-content:flex-end;padding-top:12px}
body #d2UxDiscovery .source-discovery-name-input{width:100%;max-width:none;font-size:15px}
body > .d2-ux-dialog button:focus-visible,
body > .d2-ux-dialog input:focus-visible{outline:2px solid #F59E0B!important;outline-offset:2px}

/* Desktop refresh info is owned by the ACTIVE source, not the left menu. */
html[data-device-category="desktop"] body.headerless-concept .sidebar-refresh-section {display:none!important}
#dashboard .d2-ux-header-refresh{display:inline-flex;align-items:center;gap:9px;flex:0 0 auto;margin-left:auto;min-width:0}
#dashboard .d2-ux-header-refresh .d2-ux-time{font-size:12px;font-weight:400;white-space:nowrap;opacity:.72}
#dashboard .d2-ux-header-refresh button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;
  border:0;background:transparent;box-shadow:none;padding:4px;color:inherit;border-radius:7px;cursor:pointer}
#dashboard .d2-ux-header-refresh svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
#dashboard .d2-ux-refreshing{font-size:14px;font-weight:550;line-height:1.4;padding:12px 10px;
  color:var(--d2-ink,#0D2A45);background:transparent}
#dashboard .d2-ux-refreshing.hidden{display:none!important}
#dashboard .d2-ux-dots>span{display:inline-block;overflow:hidden;white-space:nowrap;vertical-align:bottom;
  width:0;animation:d2-dot-cycle 1.2s steps(4,end) infinite}
@keyframes d2-dot-cycle{0%{width:0}100%{width:1.1em}}
@media(prefers-reduced-motion:reduce){#dashboard .d2-ux-dots>span{animation:none;width:1.1em}}
#dashboard.d2-ux-initial-fetch .desktop-empty-feed,
#dashboard.d2-ux-initial-fetch #newsBody .empty-row{display:none!important}

/* Demonstration only: cannot be selected or counted as an article. */
#dashboard .d2-ux-saved-demo{display:flex;align-items:flex-start;gap:18px;width:min(100%,770px);
  box-sizing:border-box;margin:20px auto;padding:24px;border:1px solid var(--d2-stroke,#D6E1EC);
  border-radius:11px;background:var(--d2-p2-unread,#fff);color:var(--d2-ink,#0D2A45)}
#dashboard .d2-ux-saved-demo.hidden{display:none!important}
#dashboard .d2-ux-demo-mark{flex:0 0 56px;height:56px;display:grid;place-items:center;
  background:#315EDB;color:#fff;font-weight:750;border-radius:12px;font-size:16px}
#dashboard .d2-ux-demo-kicker{font-size:12px;font-weight:500;opacity:.7}
#dashboard .d2-ux-demo-copy h2{font-size:20px;line-height:1.35;font-weight:650;margin:5px 0 10px}
#dashboard .d2-ux-demo-copy p{font-size:15px;line-height:1.55;font-weight:400;margin:0}
#dashboard .my-articles-empty-row{display:none!important}

/* Source badges, cards and read semantics. */
html[data-device-category="desktop"] body.headerless-concept #desktopNewsContainer .desktop-article-grid{gap:13px!important}
html[data-device-category="desktop"] body.headerless-concept .desktop-sidebar-unread-count{
  font-size:12px!important;line-height:1.25!important;font-weight:400!important;min-height:19px!important}
#dashboard .news-row[data-read="unread"] .story-meta-line .read-indicator,
html.theme-dark #dashboard .news-row[data-read="unread"] .story-meta-line .read-indicator{
  background:#F59E0B!important;border-color:#F59E0B!important
}
#dashboard .news-row[data-read="read"] .story-meta-line .read-indicator,
html.theme-dark #dashboard .news-row[data-read="read"] .story-meta-line .read-indicator{
  border-color:#d58a13!important;background:transparent!important
}
/* Keep selected geometry invariant; restore natural flow without added rails. */
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row,
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row.selected{
  margin-left:0!important;margin-right:0!important;border-left:0!important;
  transform:none!important;box-shadow:none!important;
}
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row[data-read] > .story-card-cell{
  background:transparent!important;box-shadow:none!important
}
html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-card-shell{
  box-sizing:border-box!important;width:100%!important;margin-left:0!important;margin-right:0!important
}
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row.selected .d2-p2-card-shell{
  transform:none!important;margin-left:0!important;margin-right:0!important
}
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row .story-title-trigger{
  font-weight:650!important
}
html[data-device-category="mobile"] body.headerless-concept #newsBody .news-row[data-read="read"] .story-title-trigger{
  font-weight:500!important
}
/* Mobile source label: whole available region is a touch target. */
html[data-device-category="mobile"] body.headerless-concept #d2MobileCurrentSource{
  flex:1 1 auto!important;min-width:0!important;max-width:none!important;
  font-weight:500!important;min-height:44px!important;justify-content:flex-end!important;
  cursor:pointer;overflow:hidden
}
html[data-device-category="mobile"] body.headerless-concept #d2MobileSourceText{
  font-weight:500!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
/* Mobile actions: same hierarchy/size for Summary/Background/Ask/Original/Save. */
@media(max-width:900px){
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;min-width:0!important;gap:5px!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-button,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-original-link,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-save-button{
    box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
    font-family:inherit!important;font-size:clamp(12px,3.55vw,15px)!important;
    font-weight:600!important;line-height:1.2!important;white-space:nowrap!important;
    overflow-wrap:normal!important;padding:7px 2px!important;
    text-align:center!important;background:transparent!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-button span{
    min-width:0!important;overflow-wrap:normal!important;white-space:nowrap!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-history,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-result,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .preview-ai-response{
    font-family:inherit!important;font-size:var(--mobile-ai-size,20px)!important;
    font-weight:400!important;line-height:1.5!important;
    background:transparent!important;color:inherit!important;box-shadow:none!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-history p,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-result p,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-history li,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-result li{
    font-family:inherit!important;font-size:inherit!important;font-weight:400!important;line-height:1.5!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .analysis-external-icon,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .story-desc-toggle,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-collapse-chevron{
    background:transparent!important;background-image:none!important;box-shadow:none!important;
    border:0!important;border-radius:0!important
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .ask-submit>span{
    font-size:26px!important;line-height:1!important
  }
  body .d2-ux-input-row{flex-direction:column}
  body #d2UxSearch{width:100%!important}
  #dashboard .d2-ux-saved-demo{margin:15px 10px;padding:17px;gap:12px}
  #dashboard .d2-ux-demo-mark{flex-basis:43px;height:43px;font-size:13px}
  #dashboard .d2-ux-demo-copy h2{font-size:18px}
}
@media(max-width:900px){
  body > .d2-ux-dialog,
  body > #d2SourceManagerPanel.d2-manager-panel:not(.hidden),
  html[data-device-category="mobile"] body.headerless-concept #settingsPanel.headerless-settings-drawer:not(.hidden){
    position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;
    transform:none!important;width:100vw!important;max-width:100vw!important;
    height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;
    overflow-y:auto!important;padding:calc(16px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom))!important;
    border:0!important;border-radius:0!important;box-shadow:none!important
  }
}


/* v18 QA: all three dialog surfaces must live above the same backdrop,
   centred within the VIEWPORT (not positioned by the long dashboard). */
body > .d2-ux-backdrop:not(.hidden) { z-index:20000 !important; }
body > #d2UxAddDialog:not(.hidden),
body > #d2SourceManagerPanel:not(.hidden),
html body > #settingsPanel:not(.hidden) {
  z-index:20002 !important;
  isolation:isolate;
  visibility:visible !important;
  pointer-events:auto !important;
}
body.headerless-concept #d2SourceManagerBackdrop {
  display:none !important; /* one shared scrim, never a second dark overlay */
}
html[data-device-category="desktop"] body.headerless-concept > #settingsPanel.headerless-settings-drawer:not(.hidden),
html[data-device-category="desktop"] body.headerless-concept > #d2SourceManagerPanel.d2-manager-panel:not(.hidden),
html[data-device-category="desktop"] body > #d2UxAddDialog:not(.hidden) {
  top:50dvh !important;
  left:50vw !important;
  transform:translate(-50%,-50%) !important;
  right:auto !important;
  bottom:auto !important;
  max-height:calc(100dvh - 48px) !important;
}
/* Same surfaces in the existing mobile full-screen dialog presentation. */
@media(max-width:900px) {
  html body > #d2UxAddDialog:not(.hidden),
  html body > #d2SourceManagerPanel.d2-manager-panel:not(.hidden),
  html body > #settingsPanel.headerless-settings-drawer:not(.hidden) {
    top:0 !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    transform:none !important;
    width:100vw !important;
    height:100dvh !important;
    max-width:100vw !important;
    max-height:100dvh !important;
    overflow-y:auto !important;
  }
}
/* The outside of a read/selected card must be the same workspace as all rows.
   Only the native shell itself has the read/unread fill; keep curved blue
   selected-corner accents attached to that shell. */
@media(max-width:900px) {
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row[data-read],
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row.selected,
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row[data-read] > td.story-card-cell,
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row.selected > td.story-card-cell {
    background:transparent !important;
    background-color:transparent !important;
    background-image:none !important;
    box-shadow:none !important;
    outline-color:transparent !important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row[data-read]::before,
  html[data-device-category="mobile"] body.headerless-concept #newsBody tr.news-row[data-read]::after {
    content:none !important; /* never the shell's approved corner pseudo-elements */
  }
  /* Uniform neutral AI buttons, regardless of active action or mode. */
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions {
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    column-gap:4px !important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-ai-button,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-ai-button[data-action="summary"],
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-ai-button.selected {
    background:transparent !important;
    background-image:none !important;
    border:1px solid var(--d2-p2-edge,var(--d2-stroke)) !important;
    border-radius:8px !important;
    box-shadow:none !important;
    color:inherit !important;
    font-size:clamp(12px,3.55vw,15px) !important;
    font-weight:600 !important;
    line-height:1.15 !important;
    white-space:nowrap !important;
    overflow-wrap:normal !important;
    min-width:0 !important;
    padding:6px 2px !important;
    gap:3px !important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-ai-button *,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-ai-button span {
    white-space:nowrap !important;
    overflow-wrap:normal !important;
    word-break:normal !important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .d2-p2-mobile-analysis-host .analysis-ai-actions .analysis-action-icon {
    width:14px !important; height:14px !important; flex:0 0 14px !important;
  }
  html[data-device-category="mobile"] body.headerless-concept .day-collapse-button,
  html[data-device-category="mobile"] body.headerless-concept .day-collapse-chevron,
  html[data-device-category="mobile"] body.headerless-concept .day-row.collapsed .day-collapse-button,
  html[data-device-category="mobile"] body.headerless-concept .day-row.collapsed .day-collapse-chevron {
    background:transparent !important;background-image:none !important;
    box-shadow:none !important;border:0 !important;
    border-radius:0 !important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .analysis-external-icon,
  html[data-device-category="mobile"] body.headerless-concept #newsBody .analysis-external-icon svg {
    display:inline-block !important; background:transparent !important;
    background-image:none !important; border:none !important;
    box-shadow:none !important;
  }
}
/* The external-link glyph is a real SVG stroke, not an emoji with a colored
   platform-drawn square behind it. */
.analysis-external-icon svg {
  width:1em; height:1em; vertical-align:middle;
  fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round;
}
/* Use previous/live refresh glyph's filled outline, not a new thin line icon. */
body.headerless-concept .d2-ux-header-refresh svg {
  fill:currentColor !important;
  stroke:none !important;
}

/* Day expand/collapse indicator: vector strokes only, never a glyph tile. */
.day-collapse-chevron svg {
  display:block!important;
  width:12px!important;
  height:12px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  background:transparent!important;
  box-shadow:none!important;
  border:none!important;
}


/* V18.2: resolve the legacy V10 drawer's stronger offscreen/hidden rules.
   These selectors deliberately match the OLD high-specificity settings
   selectors; all three dialogs remain on document.body above ONE scrim. */
body.d2-ux-modal-active.settings-open::before {
  content:none!important;display:none!important;
}
body.d2-ux-modal-active .settings-backdrop,
body.d2-ux-modal-active #settingsOverlay {
  display:none!important;
}
html[data-device-category="desktop"] body.design-preview.stage2.headerless-concept.settings-open > #settingsPanel.settings-panel.headerless-settings-drawer:not(.hidden),
html[data-device-category="desktop"] body.design-preview.stage2.headerless-concept.d2-ux-modal-active > #settingsPanel.settings-panel.headerless-settings-drawer:not(.hidden) {
  display:flex!important; flex-direction:column!important;
  position:fixed!important;
  inset:auto!important;
  top:50dvh!important;left:50vw!important;right:auto!important;bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(620px,calc(100vw - 36px))!important;
  height:auto!important; max-height:calc(100dvh - 44px)!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  z-index:50010!important;transition:none!important;
}
html[data-device-category="mobile"] body.design-preview.stage2.headerless-concept.settings-open > #settingsPanel.settings-panel.headerless-settings-drawer:not(.hidden),
html[data-device-category="mobile"] body.design-preview.stage2.headerless-concept.d2-ux-modal-active > #settingsPanel.settings-panel.headerless-settings-drawer:not(.hidden) {
  display:flex!important;flex-direction:column!important;
  position:fixed!important;inset:0!important;
  top:0!important;left:0!important;right:0!important;bottom:0!important;
  transform:none!important;
  width:100vw!important;min-width:0!important;max-width:100vw!important;
  height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;
  overflow-y:auto!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  z-index:50010!important;transition:none!important;
}
html body.headerless-concept > #d2SourceManagerPanel.d2-manager-panel:not(.hidden),
html body.headerless-concept > #d2UxAddDialog.d2-ux-dialog:not(.hidden) {
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;
  z-index:50010!important;
}
html body > #d2UxBackdrop.d2-ux-backdrop:not(.hidden) {
  z-index:50000!important;
}
/* Desktop: three action icons remain centered in their utility strip.
   The EXISTING My articles button is moved into the scrollable source nav by
   v18 JS; no button is cloned and the mobile sidebar is not rearranged. */
html[data-device-category="desktop"] body.headerless-concept .sidebar-quick-actions.v8-utility-row {
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
}
html[data-device-category="desktop"] body.headerless-concept .sidebar-quick-actions .desktop-sidebar-head-controls.v8-actions {
  margin:0 auto!important;
  display:flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  gap:10px!important;
}
html[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved {
  display:flex!important;
  flex:0 0 auto!important;
  width:100%!important;
  box-sizing:border-box!important;
  min-height:34px!important;
  margin:0 0 7px!important;
  padding:6px 9px!important;
  color:inherit;
  text-align:left!important;
}
html[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved.active {
  background:var(--d2-p2-read,#e7eff9)!important;
}
/* No global layout, article, source, auth or AI-state CSS is changed here. */

/* v18.3 staging-only QA corrections: scope to mobile management/feed and
   desktop Saved hover; keep approved Settings and Add dialogs untouched. */
@media (max-width:900px) {
  html[data-device-category="mobile"] body.d2-ux-mobile-manager-open {
    position:fixed!important;left:0!important;right:0!important;
    width:100%!important;overflow:hidden!important;
  }
  html[data-device-category="mobile"] body.headerless-concept > #d2SourceManagerPanel.d2-manager-panel:not(.hidden) {
    position:fixed!important;
    inset:auto!important;top:50dvh!important;left:12px!important;
    right:12px!important;bottom:auto!important;
    transform:translateY(-50%)!important;
    width:calc(100vw - 24px)!important;max-width:none!important;
    height:auto!important;min-height:0!important;
    max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    padding:16px 16px calc(18px + env(safe-area-inset-bottom))!important;
    border-radius:12px!important;
  }
  html[data-device-category="mobile"] body > #d2SourceManagerPanel .d2-manager-titlebar {
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    gap:12px!important;position:sticky;top:0;z-index:2;
    background:inherit;padding-bottom:12px;margin-bottom:14px;
  }
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #d2SourceManagerClose {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    flex:0 0 44px!important;width:44px!important;height:44px!important;
    padding:0!important;visibility:visible!important;opacity:1!important;
    position:relative!important;pointer-events:auto!important;
    color:inherit!important;background:transparent!important;border:0!important;
    font-size:28px!important;line-height:1!important;z-index:3;
  }
  #dashboard #newsBody .day-heading {flex-wrap:wrap!important;}
  #dashboard #newsBody .d2-ux-header-refresh {margin-left:auto!important;gap:4px!important;}
  #dashboard #newsBody .d2-ux-header-refresh .d2-ux-time {font-size:11px!important;}
  #dashboard #newsBody .d2-ux-header-refresh button {min-width:40px;min-height:40px;}
}
@media(max-width:390px) {
  #dashboard #newsBody .d2-ux-header-refresh {
    width:100%!important;justify-content:flex-end!important;
  }
}
html[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved:hover:not(.active) {
  background:#F8FAFC!important; /* ordinary desktop source hover */
}
html.theme-dark[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved:hover:not(.active) {
  background:#172033!important; /* ordinary dark source hover */
}
html[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved.active {
  background:#F0F5FB!important; /* ordinary active source, not the special Saved highlight */
}
html.theme-dark[data-device-category="desktop"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved.active {
  background:#2b3e55!important;
}


/* v18.4 QA candidate: preserve original dialog close buttons/handlers.
   Make Settings and Manage Sources X match the existing Add dialog. */
body > #settingsPanel .settings-panel-head,
body > #d2SourceManagerPanel .d2-manager-titlebar {
  display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important;
}
body > #settingsPanel .settings-panel-head #settingsCloseBtn,
body > #d2SourceManagerPanel .d2-manager-titlebar #d2SourceManagerClose {
  appearance:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  padding:0!important;margin:0!important;position:relative!important;inset:auto!important;
  background:transparent!important;border:0!important;box-shadow:none!important;border-radius:7px!important;
  color:inherit!important;font-size:28px!important;font-weight:400!important;line-height:1!important;
  visibility:visible!important;opacity:1!important;cursor:pointer!important;
}
/* Previous 100%-width feed scroll had additional 12px left/right padding.
   Give padded mobile regions border-box sizing; do not change article cards. */
@media(max-width:900px) {
  html[data-device-category="mobile"] body.stage2.headerless-concept .stage-reading-region,
  html[data-device-category="mobile"] body.stage2.headerless-concept .stage-feed-scroll,
  html[data-device-category="mobile"] body.headerless-concept #newsTableWrap,
  html[data-device-category="mobile"] body.headerless-concept #newsBody {
    box-sizing:border-box!important;min-width:0!important;max-width:100%!important;
  }
  html[data-device-category="mobile"] body.stage2.headerless-concept .stage-feed-scroll {
    width:100%!important;overflow-x:hidden!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsTableWrap {
    width:100%!important;overflow-x:hidden!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-heading {
    display:flex!important;flex-flow:row nowrap!important;align-items:center!important;justify-content:flex-start!important;
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
    gap:clamp(2px,.65vw,5px)!important;overflow:hidden!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-heading .day-collapse-button {
    flex:0 1 auto!important;min-width:0!important;max-width:29%!important;
    padding:0 2px!important;white-space:nowrap!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-heading .day-heading-label {
    white-space:nowrap!important;font-size:clamp(10px,2.9vw,12px)!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-heading .day-filter-controls {
    display:inline-flex!important;flex:0 1 auto!important;min-width:0!important;
    gap:2px!important;white-space:nowrap!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #newsBody .day-heading .day-filter-button {
    flex:0 1 auto!important;min-width:0!important;min-height:34px!important;
    font-size:clamp(9px,2.8vw,12px)!important;letter-spacing:normal!important;
    padding:3px!important;white-space:nowrap!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #dashboard #newsBody .d2-ux-header-refresh {
    display:inline-flex!important;align-items:center!important;justify-content:flex-end!important;
    flex:0 0 auto!important;width:auto!important;max-width:none!important;
    min-width:0!important;gap:2px!important;margin-left:auto!important;
    white-space:nowrap!important;align-self:center!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #dashboard #newsBody .d2-ux-time {
    font-size:10px!important;line-height:1!important;white-space:nowrap!important;letter-spacing:normal!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #dashboard #newsBody .d2-ux-header-refresh button {
    flex:0 0 38px!important;min-width:38px!important;width:38px!important;
    min-height:38px!important;height:38px!important;padding:7px!important;
  }
  html[data-device-category="mobile"] body > #settingsPanel #settingsCloseBtn,
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #d2SourceManagerClose {
    flex:0 0 44px!important;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  }
  html[data-device-category="mobile"],
  html[data-device-category="mobile"] body {overflow-x:clip!important;max-width:100%!important;}
}


/* v18.5 staging QA candidate — share Add dialog's neutral single-X treatment.
   IDs and original close/rename/settings handlers are deliberately unchanged. */
body > #d2UxAddDialog .d2-ux-dialog-header #d2UxClose.d2-ux-close,
html body > #settingsPanel .settings-panel-head #settingsCloseBtn.d2-ux-close,
html body > #d2SourceManagerPanel .d2-manager-titlebar #d2SourceManagerClose.d2-ux-close,
html[data-device-category="mobile"] body #desktopSourceSidebar #d2MobileDrawerClose.d2-ux-close {
  appearance:none!important;-webkit-appearance:none!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  flex:0 0 38px!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;
  position:relative!important;inset:auto!important;margin:0!important;padding:0!important;
  color:var(--d2-ink,#0D2A45)!important;-webkit-text-fill-color:currentColor!important;
  background:transparent!important;background-color:transparent!important;border:0!important;
  border-radius:7px!important;box-shadow:none!important;text-shadow:none!important;filter:none!important;
  font:400 28px/1 Arial,sans-serif!important;opacity:1!important;visibility:visible!important;
  cursor:pointer!important;z-index:3!important;
}
body > #d2UxAddDialog #d2UxClose:focus-visible,
html body > #settingsPanel #settingsCloseBtn:focus-visible,
html body > #d2SourceManagerPanel #d2SourceManagerClose:focus-visible,
html[data-device-category="mobile"] body #d2MobileDrawerClose:focus-visible {
  outline:2px solid #315EDB!important;outline-offset:2px!important;
}
@media(max-width:900px) {
  html[data-device-category="mobile"] body > #d2UxAddDialog #d2UxClose,
  html[data-device-category="mobile"] body > #settingsPanel #settingsCloseBtn,
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #d2SourceManagerClose,
  html[data-device-category="mobile"] body #desktopSourceSidebar #d2MobileDrawerClose {
    flex-basis:44px!important;width:44px!important;height:44px!important;
    min-width:44px!important;min-height:44px!important;
  }
}
html.theme-dark body > #d2UxAddDialog #d2UxClose.d2-ux-close,
html.theme-dark body > #settingsPanel #settingsCloseBtn.d2-ux-close,
html.theme-dark body > #d2SourceManagerPanel #d2SourceManagerClose.d2-ux-close,
html.theme-dark[data-device-category="mobile"] body #desktopSourceSidebar #d2MobileDrawerClose {
  color:var(--d2-ink,#E8F1FB)!important;
}

/* Compact Manage News Sources rows; the original rename, ordering, delete and
   unsaved-rename safeguards still own the DOM. No ghost margins/blank rows. */
body > #d2SourceManagerPanel .d2-manager-titlebar {
  margin-bottom:8px!important;padding-bottom:8px!important;
}
body > #d2SourceManagerPanel .custom-source-settings-row {
  padding:5px 0 0!important;margin:0!important;
}
body > #d2SourceManagerPanel .custom-source-settings-row > label {
  display:block!important;margin:0 0 5px!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList {
  display:grid!important;gap:0!important;margin:0!important;padding:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-item {
  display:grid!important;grid-template-columns:70px minmax(0,1fr) 34px!important;
  align-items:center!important;gap:7px!important;
  min-height:44px!important;margin:0!important;padding:3px 0!important;
  border-bottom:1px solid var(--d2-stroke,#D6E1EC)!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-order-actions {
  display:flex!important;flex-direction:row!important;justify-content:flex-start!important;
  align-self:center!important;gap:3px!important;width:auto!important;margin:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-main {
  min-width:0!important;margin:0!important;padding:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-name-line {
  display:flex!important;align-items:center!important;gap:5px!important;margin:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-name-input {
  min-width:0!important;width:100%!important;max-width:100%!important;
  box-sizing:border-box!important;margin:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-url {
  margin:2px 0 0!important;font-size:10px!important;line-height:1.2!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-actions {
  grid-column:auto!important;align-self:center!important;display:flex!important;
  align-items:center!important;justify-content:center!important;
  padding:0!important;margin:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-row-status:empty {
  display:none!important;
}
@media(max-width:900px) {
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-item {
    grid-template-columns:90px minmax(0,1fr) 44px!important;
    gap:4px!important;min-height:48px!important;
  }
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-order-actions button {
    width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;
    padding:0!important;margin:0!important;
  }
  html[data-device-category="mobile"] body > #d2SourceManagerPanel #customSourcesSettingsList .custom-source-setting-actions .custom-source-remove {
    width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;
    padding:8px!important;
  }
}

/* Mobile source navigation is a content-sized top drawer, not 100dvh.
   Desktop sticky sidebar stays untouched. For a long account source list,
   keep the close button/actions fixed and scroll ONLY the source navigation. */
@media(max-width:900px) {
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar.desktop-source-sidebar {
    top:0!important;bottom:auto!important;left:0!important;right:auto!important;
    height:auto!important;min-height:0!important;
    max-height:calc(100dvh - env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;overflow:hidden!important;
    padding-bottom:calc(8px + env(safe-area-inset-bottom))!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar .sidebar-fixed-brand {
    display:flex!important;flex:0 0 70px!important;min-height:70px!important;
    width:100%!important;box-sizing:border-box!important;gap:5px!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar #d2MobileDrawerClose {
    display:inline-flex!important;margin-left:auto!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar .sidebar-quick-actions {
    flex:0 0 54px!important;min-height:54px!important;width:100%!important;
    display:flex!important;justify-content:center!important;align-items:center!important;
    box-sizing:border-box!important;margin:0!important;padding:4px 8px!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar .desktop-sidebar-head-controls.v8-actions {
    display:flex!important;align-items:center!important;justify-content:center!important;
    flex:0 0 auto!important;gap:9px!important;
    margin:0 auto!important;padding:0!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar .sidebar-refresh-section {
    display:none!important;min-height:0!important;padding:0!important;margin:0!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSourceSidebar #desktopSidebarNav.desktop-sidebar-nav {
    display:block!important;flex:0 1 auto!important;min-height:0!important;
    max-height:calc(100dvh - 175px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;overflow-x:hidden!important;
    overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important;
    box-sizing:border-box!important;
    padding:4px 9px 8px!important;margin:0!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved.desktop-sidebar-source {
    display:flex!important;align-items:center!important;width:100%!important;min-height:44px!important;
    margin:0 0 3px!important;padding:7px 11px!important;box-sizing:border-box!important;
    border:0!important;border-radius:8px!important;
    gap:8px!important;flex:0 0 auto!important;
    color:var(--m-text)!important;background:transparent!important;
    font:650 13px/1.3 'Avenir Next',Avenir,Arial,sans-serif!important;
    text-align:left!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved.active {
    background:var(--m-active)!important;box-shadow:inset 3px 0 0 #669bd3!important;
  }
  html[data-device-category="mobile"] body.headerless-concept #desktopSidebarNav > #desktopSidebarSaved .desktop-sidebar-special-icon {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    flex:0 0 18px!important;width:18px!important;
  }
  html[data-device-category="desktop"] body #d2MobileDrawerClose,
  html:not([data-device-category="mobile"]) body #d2MobileDrawerClose {display:none!important;}
}

/* R15-QA closed Settings drawer display invariant (2026-10-29).
   Older approved-design-v17.css forces the closed drawer to display:flex !important
   with higher specificity, leaving a 435px panel off screen at left:1455px on
   1440px desktop. Prevent the hidden panel from contributing to scrollWidth,
   while retaining the established open-drawer styles and animations. */
html[data-device-category="desktop"] body.design-preview.stage2.headerless-concept #settingsPanel.headerless-settings-drawer.hidden,
html[data-device-category="mobile"] body.design-preview.stage2.headerless-concept #settingsPanel.headerless-settings-drawer.hidden {
  display: none !important;
}

/* UI Changes 1029: show the source drawer X only on mobile. */
@media (min-width:901px) {
  html[data-device-category="desktop"] body.headerless-concept #d2MobileDrawerClose {display:none!important;}
}

/* UI1029 combined package: Add modal concise header and compact result list.
   Exact heights match for all three interactive form/action controls. */
body > .d2-ux-dialog .d2-ux-dialog-header { margin-bottom:14px!important; }
body > .d2-ux-dialog .d2-ux-dialog-header #d2UxHelp {
  font-size:20px!important;line-height:1.3!important;font-weight:700!important;
  margin:0!important;opacity:1!important;
}
body > .d2-ux-dialog #d2UxUrl,
body > .d2-ux-dialog #d2UxSearch,
body > .d2-ux-dialog #sourceDiscoveryAddSelected {
  box-sizing:border-box!important;height:38px!important;min-height:38px!important;
  max-height:38px!important;line-height:1.25!important;
}
body > .d2-ux-dialog #d2UxUrl {padding:6px 10px!important;}
body > .d2-ux-dialog #d2UxSearch,
body > .d2-ux-dialog #sourceDiscoveryAddSelected {padding:6px 12px!important;}
body > .d2-ux-dialog #sourceDiscoveryCount {display:none!important;}
body > .d2-ux-dialog .source-discovery-head {margin-bottom:7px!important;}
body > .d2-ux-dialog .source-discovery-item {
  grid-template-columns:19px 25px minmax(0,1fr)!important;
  align-items:start!important;gap:7px!important;
  padding:7px 9px!important;border-radius:8px!important;
}
body > .d2-ux-dialog .source-discovery-checkbox {margin-top:4px!important;}
body > .d2-ux-dialog .source-discovery-favicon-wrap {margin-top:2px!important;width:23px!important;height:23px!important;}
body > .d2-ux-dialog .source-discovery-favicon {width:21px!important;height:21px!important;}
body > .d2-ux-dialog .source-discovery-main {
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:3px!important;
}
body > .d2-ux-dialog .source-discovery-name-input {
  width:min(100%,290px)!important;max-width:290px!important;min-width:0!important;
  height:29px!important;min-height:29px!important;
  padding:4px 7px!important;font-size:14px!important;line-height:1.2!important;
  font-weight:650!important;box-sizing:border-box!important;
}
body > .d2-ux-dialog .source-discovery-url {
  width:100%!important;min-width:0!important;overflow:hidden!important;
  white-space:nowrap!important;text-overflow:ellipsis!important;
  font-size:10px!important;
}
body > .d2-ux-dialog .source-discovery-meta {display:none!important;}
body > .d2-ux-dialog .source-discovery-actions {margin-top:7px!important;padding-top:7px!important;}
/* The manager has one independent group control, and separate child controls
   which cannot move a feed across a publisher boundary. */
body > #d2SourceManagerPanel #customSourcesSettingsList .source-manager-publisher-header {
  display:flex!important;align-items:center!important;justify-content:space-between!important;
  gap:7px!important;padding:5px 2px 2px!important;margin-top:6px!important;
  border-bottom:1px solid var(--d2-stroke,#D6E1EC)!important;
  font-size:12px!important;font-weight:700!important;min-width:0!important;
}
body > #d2SourceManagerPanel #customSourcesSettingsList .source-manager-publisher-header:first-child {margin-top:0!important;}
body > #d2SourceManagerPanel .source-manager-publisher-name {
  flex:1 1 auto!important;overflow:hidden!important;text-overflow:ellipsis!important;
  white-space:nowrap!important;color:inherit!important;
}
body > #d2SourceManagerPanel .source-manager-publisher-actions {
  display:flex!important;align-items:center!important;gap:4px!important;flex:0 0 auto!important;
}
body > #d2SourceManagerPanel .source-manager-publisher-actions button {
  width:28px!important;min-width:28px!important;height:28px!important;min-height:28px!important;
  padding:0!important;margin:0!important;border:0!important;background:transparent!important;
  color:inherit!important;box-shadow:none!important;font-size:17px!important;cursor:pointer!important;
}
body > #d2SourceManagerPanel .source-manager-publisher-actions button:disabled {opacity:.26!important;cursor:default!important;}
@media(max-width:900px) {
  body > .d2-ux-dialog #d2UxUrl,
  body > .d2-ux-dialog #d2UxSearch,
  body > .d2-ux-dialog #sourceDiscoveryAddSelected {
    height:42px!important;min-height:42px!important;max-height:42px!important;
  }
  body > .d2-ux-dialog .source-discovery-name-input {width:min(100%,230px)!important;}
  body > #d2SourceManagerPanel .source-manager-publisher-actions button {
    width:42px!important;min-width:42px!important;height:42px!important;min-height:42px!important;
  }
}
