/*
 * styles-5-news-article-list.css
 *
 * News article list, author display, weather collapse, hourly forecast, sortable drag.
 *
 * Phase 5 S3 pass-2: extracted from the monolithic styles.css
 * (8 286 LOC) to bring every CSS source file under the < 1 500
 * LOC bar. Load order in index.html preserves the original
 * cascade exactly: this file occupies lines 3701 - 4841 of the
 * pre-split styles.css.
 */


.tile-collapse-btn:hover {
  background: var(--prefs-toggle-hover);
  border-color: var(--accent);
  color: var(--text);
}

.tile-collapse-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tile-collapse-btn__label {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.dashboard-tile--collapsed {
  align-self: start;
  /* Default tiles use height:100% to fill the grid row; collapsed tiles must size to the header only */
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
}

#commute-card.dashboard-tile--collapsed > :not(#commute-title) {
  display: none !important;
}

/* Weather “collapse” only hides the hourly strip (+ caption); current conditions stay visible. */
#weather-card.dashboard-tile--collapsed .hourly-forecast__caption,
#weather-card.dashboard-tile--collapsed .hourly-forecast {
  display: none !important;
}

/* Error / placeholder strip when forecast isn’t a horizontal scroller */
#weather-card:has(#weather-hourly:not(.hourly-forecast)) .hourly-forecast__caption {
  display: none !important;
}

#stocks-tile.dashboard-tile--collapsed .stocks-wrap,
#stocks-tile.dashboard-tile--collapsed .tile-resize-handle {
  display: none !important;
}

#currency-tile.dashboard-tile--collapsed #fx-conversion-panel > :not(.card__top--tile) {
  display: none !important;
}

#todo-card.dashboard-tile--collapsed .todo-scroll,
#todo-card.dashboard-tile--collapsed .todo-card__footer {
  display: none !important;
}

#tile-news.dashboard-tile--collapsed .news-category-audio-toolbar,
#tile-news.dashboard-tile--collapsed .news-summary__row,
#tile-news.dashboard-tile--collapsed .news-tiles,
#tile-news.dashboard-tile--collapsed .tile-resize-handle {
  display: none !important;
}

#tile-ipl.dashboard-tile--collapsed .ipl-scroll {
  display: none !important;
}

/*
  Resizable news/stocks tiles use fixed heights in CSS (40vh / 50vh). Clearing inline
  height on collapse would otherwise let those rules expand the shell again. Currency
  uses tile-type-horizontal min-height — override when collapsed so only the header shows.
*/
#stocks-tile.card--stocks.dashboard-tile--resizable-v.dashboard-tile--collapsed,
#tile-news.news-summary--toolbar.dashboard-tile--resizable-v.dashboard-tile--collapsed {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

#currency-tile.card--currency.dashboard-tile--collapsed.tile-type-horizontal {
  min-height: 0 !important;
  max-height: none !important;
}

#currency-tile.dashboard-tile--collapsed #fx-conversion-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

html[data-theme="midnight"] .tile-collapse-btn,
html[data-theme="nord"] .tile-collapse-btn {
  background: var(--surface-alt);
}

.dashboard-tile--weather > .weather-inline {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.dashboard-tile--weather.tile-type-horizontal-scroll .weather-inline {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.dashboard-tile--weather .weather-inline__summary {
  flex-shrink: 0;
  width: 100%;
  min-width: 0;
}

.news-summary--toolbar {
  padding: var(--space-3) var(--space-4) var(--space-5);
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--surface) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tight);
  display: grid;
  gap: var(--space-2);
  align-content: start;
  min-height: min(28rem, 52svh);
}

#tile-news.news-summary--toolbar.dashboard-tile--resizable-v {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  min-height: min(16rem, 36vh);
  height: 50vh;
  box-sizing: border-box;
  overflow: hidden;
}

#tile-news.news-summary--toolbar.dashboard-tile--resizable-v .news-summary__head--tile,
#tile-news.news-summary--toolbar.dashboard-tile--resizable-v .news-category-audio-toolbar,
#tile-news.news-summary--toolbar.dashboard-tile--resizable-v .news-summary__row {
  flex-shrink: 0;
}

.news-category-audio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0;
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.news-category-audio-toolbar__title {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  font-size: var(--font-size-xs);
  font-weight: 500;
  color: var(--muted);
  line-height: var(--font-line-snug);
  overflow-wrap: anywhere;
}

.news-category-audio-toolbar__lead {
  font-weight: 700;
  color: var(--text);
}

.news-category-audio-toolbar__source {
  font-weight: 500;
  color: var(--muted);
}

#tile-news.news-summary--toolbar.dashboard-tile--resizable-v .news-tiles {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin-top: var(--space-2);
}

.news-summary__title {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.news-summary__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Overrides .news-summary__head flex-wrap so status + refresh + collapse stay on one row */
.news-summary__head.news-summary__head--tile {
  /* Match `.card__top--tile` so drag handles track weather tile sizing at every breakpoint */
  --drag-handle-size: 2rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0;
}

.news-summary__head--tile .tile-mobile-leading {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-summary__head--tile .news-summary__title {
  min-width: 0;
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.news-summary__head--tile #news-status {
  grid-column: 3;
  justify-self: end;
}

.news-summary__head--tile .tile-header-actions {
  grid-column: 4;
}

.news-summary__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: 0;
}

.news-summary__label {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--muted);
  max-width: 100%;
  line-height: var(--font-line-snug);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-source-select {
  font: inherit;
  font-size: var(--font-size-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  min-width: min(100%, 14rem);
  cursor: pointer;
}

.news-source-select:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

h2 {
  margin: 0;
  font-size: var(--type-section);
  font-weight: var(--font-weight-medium);
  line-height: var(--font-line-snug);
  color: var(--text);
}

.status {
  background: color-mix(in srgb, var(--surface-alt) 88%, var(--accent-soft));
  color: var(--text-secondary);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  font-size: var(--type-meta);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
}

#tile-news #news-status {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric {
  margin: 0.15rem 0;
  font-size: clamp(1.35rem, 1.08rem + 1.2vw, 1.85rem);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  letter-spacing: -0.02em;
}

.meta {
  margin: 0;
  font-size: var(--type-meta);
  font-weight: var(--font-weight-regular);
  color: var(--text-meta);
  line-height: var(--font-line-relaxed);
}

.stocks-wrap {
  margin-top: 0.65rem;
}

.stocks-title {
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.stocks-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.stock-chip {
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  border-radius: 10px;
  padding: 0.4rem 0.5rem;
}

.stock-chip__name {
  margin: 0;
  font-size: var(--type-meta);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.stock-chip__price {
  margin: 0.2rem 0 0;
  font-size: var(--type-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stock-chip__change {
  margin: 0.2rem 0 0;
  font-size: var(--type-body);
  font-weight: var(--font-weight-semibold);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stock-chip__spark {
  margin-top: 0.25rem;
  height: 24px;
  color: var(--sparkline-color);
}

.stock-chip__spark .sparkline {
  display: block;
  width: 100%;
  height: 24px;
}

.stock-chip__reason {
  margin: 0.3rem 0 0;
  font-size: var(--type-meta);
  line-height: var(--font-line-relaxed);
  color: var(--text-meta);
}

.stock-chip__reason a {
  color: inherit;
  text-decoration: none;
}

.stock-chip__reason a:hover {
  text-decoration: underline;
}

.stock-reason-wrap {
  margin-top: 0.25rem;
}

.stock-reason-toggle {
  border: 1px solid var(--reason-toggle-border);
  background: var(--reason-toggle-bg);
  color: var(--reason-toggle-text);
  border-radius: 7px;
  padding: 0.18rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.stock-reason-toggle:hover {
  filter: brightness(0.98);
}

.stock-chip__change.is-up {
  color: var(--stock-up);
}

.stock-chip__change.is-down {
  color: var(--stock-down);
}

.stock-chip__spark.is-up {
  color: var(--stock-up);
}

.stock-chip__spark.is-down {
  color: var(--stock-down);
}

.stock-chip__reason.is-up {
  color: var(--stock-up);
}

.stock-chip__reason.is-down {
  color: var(--stock-down);
}

.hourly-forecast {
  margin-top: 0.85rem;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  display: flex;
  flex-direction: row;
  gap: 0.3rem;
  padding-right: 0;
  padding-bottom: 0.2rem;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

/* Hourly strip is the only horizontal scrollport; give chips a stable row height */
.dashboard-tile--weather #weather-hourly.hourly-forecast {
  flex: 1 1 auto;
  min-height: 5.1rem;
  margin-top: 0.55rem;
}

.hourly-forecast .hour-block {
  flex-shrink: 0;
  min-width: 7.2rem;
  border: 1px solid var(--hour-border);
  border-radius: 8px;
  background: var(--hour-bg);
  padding: 0.35rem 0.42rem;
}

.hourly-forecast .hour-block__time {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--muted);
}

.hourly-forecast .hour-block__feels-label {
  margin: 0.12rem 0 0;
  font-size: 0.58rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.hourly-forecast .hour-block__temp {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.hourly-forecast .hour-block__meta {
  margin: 0.08rem 0 0;
  font-size: 0.65rem;
  line-height: 1.25;
  color: var(--muted);
}

.news-tiles {
  margin-top: var(--space-3);
  display: block;
  min-height: 0;
  max-height: min(22rem, 52vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--space-2);
  -webkit-overflow-scrolling: touch;
}

#tile-news.dashboard-tile--resizable-v .news-tiles {
  margin-top: var(--space-2);
}

.news-tile {
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--news-tile-border);
  border-radius: var(--radius-md);
  background: var(--news-tile-bg);
  padding: var(--space-1) var(--space-3) var(--space-3);
}

.news-tile__summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--news-summary);
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  padding: 0.35rem 0.15rem;
}

.news-tile--collapsible .news-tile__summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  text-align: left;
}

.news-tile--collapsible .news-tile__summary::after {
  content: "▼";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  height: 1.85rem;
  padding: 0 0.2rem;
  font-size: 0.62rem;
  line-height: 1;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(255, 122, 0, 0.45);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.news-tile--collapsible .news-tile__summary[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.news-tile__summary:disabled {
  opacity: 0.8;
  cursor: default;
}

.news-list {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.news-list li {
  color: var(--text);
  line-height: 1.45;
}

/* Full story list (Latest News tile): card scan layout + favorites plain list */
#tile-news {
  --news-card-gap: clamp(12px, 2.8vw, 16px);
}

#tile-news .news-list--all,
#favorites-card .news-list--all {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-right: 0.2rem;
  padding-bottom: 0.15rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--stock-gap, 0.34rem);
  box-sizing: border-box;
  align-content: start;
}

#tile-news .news-list--all {
  gap: var(--news-card-gap);
}

#tile-news .news-list--all .news-item--card {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--chip-border) 88%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--chip-bg) 96%, var(--surface));
  padding: 0;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 35%, transparent);
}

#tile-news .news-list--all .news-item--card:nth-child(even) {
  background: color-mix(in srgb, var(--surface-alt) 42%, var(--chip-bg));
}

#tile-news .news-item__shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.25rem;
  min-height: 3.15rem;
  padding: 0.48rem 0.42rem 0.48rem 0.52rem;
}

#tile-news .news-item__tap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: start;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  outline: none;
}

#tile-news .news-item__tap--has-thumb {
  grid-template-columns: clamp(3.1rem, 20vw, 4.25rem) minmax(0, 1fr);
}

#tile-news .news-item__thumb-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  aspect-ratio: 1;
  align-self: start;
}

#tile-news .news-item__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#tile-news .news-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

#tile-news .news-item__title {
  margin: 0;
  /* Override global .news-item__title { flex: 1 1 10rem } — growth was stretching the title box and leaving a gap above “hours ago”. */
  flex: 0 1 auto;
  font-weight: 650;
  font-size: clamp(0.78rem, 2.5vw, 0.94rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--text);
}

#tile-news .news-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.18rem 0.32rem;
  font-size: clamp(0.58rem, 1.9vw, 0.7rem);
  color: var(--muted);
  line-height: 1.25;
}

#tile-news .news-item__source {
  font-weight: 600;
  color: var(--text-secondary);
  max-width: min(100%, 11rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tile-news .news-item__sep {
  font-weight: 700;
  opacity: 0.4;
}

#tile-news .news-item__time {
  font-variant-numeric: tabular-nums;
}

#tile-news .news-item__actionbar {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.32rem;
  padding: 0.2rem 0.15rem 0.2rem 0.38rem;
  margin: -0.08rem 0;
  border-inline-start: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  flex-shrink: 0;
}

#tile-news .news-item--card .news-audio-btn,
#tile-news .news-item--card .news-bookmark-btn {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.88rem;
}

#tile-news .news-item__tap-link:hover .news-item__title {
  color: color-mix(in srgb, var(--accent) 22%, var(--text));
}

#tile-news .news-item__tap-link:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

#favorites-card .news-list--all .news-item {
  margin: 0;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 0.28rem 0.38rem;
  min-width: 0;
  box-sizing: border-box;
}

#tile-news .skeleton-news-list {
  list-style: none;
  margin: 0;
  padding: 0 0.2rem 0.15rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--news-card-gap);
  box-sizing: border-box;
}

#tile-news .skeleton-news-list--cards .news-skeleton-card {
  list-style: none;
  margin: 0;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--chip-border) 88%, transparent);
  background: color-mix(in srgb, var(--chip-bg) 96%, var(--surface));
  overflow: hidden;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--border) 35%, transparent);
}

#tile-news .skeleton-news-list--cards .news-skeleton-card:nth-child(even) {
  background: color-mix(in srgb, var(--surface-alt) 42%, var(--chip-bg));
}

.news-skeleton-card__shell {
  display: grid;
  grid-template-columns: clamp(3.1rem, 20vw, 4.25rem) minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.48rem 0.42rem 0.48rem 0.52rem;
  min-height: 3.6rem;
}

.news-skeleton-card__thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
}

.news-skeleton-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.skeleton-line--title-short {
  width: 72%;
  margin-bottom: 0 !important;
}

.news-skeleton-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  padding-inline-start: 0.35rem;
  margin-inline-start: 0.15rem;
  border-inline-start: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}

.news-skeleton-card__action-dot {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
}

.news-item__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.4rem 0.65rem;
  justify-content: space-between;
}

.news-item__actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.news-audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Phase 4 S4 a11y: visual circle stays compact (2.05rem ≈ 33px) but
     the hit area is bumped to the WCAG floor. Achieved with min-* so
     the button widens in place rather than shifting layout. */
  width: 2.05rem;
  height: 2.05rem;
  min-width: var(--touch-target-min, 48px);
  min-height: var(--touch-target-min, 48px);
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    opacity 0.15s ease;
}

.news-audio-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--prefs-toggle-hover);
}

.news-audio-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.news-audio-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.news-audio-btn.is-loading {
  opacity: 1;
  pointer-events: none;
}

.news-audio-btn__spinner {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  box-sizing: border-box;
  /* Spinner rotation gated on motion-enabled users (Phase 4 S2). Under
     reduced-motion we keep the static partial-ring as a non-rotating
     "loading" affordance — the button's `aria-busy` is the source of
     truth for screen readers either way. */
}
@media (prefers-reduced-motion: no-preference) {
  .news-audio-btn__spinner {
    animation: news-audio-spin 0.65s linear infinite;
  }
}

@keyframes news-audio-spin {
  to {
    transform: rotate(360deg);
  }
}

.news-audio-btn.is-playing {
  border-color: var(--accent);
  color: var(--accent);
}

.news-audio-btn.is-paused {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent);
}

.news-item__title {
  flex: 1 1 10rem;
  min-width: 0;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  color: var(--text);
}

.news-list--extra {
  margin-top: 0.4rem;
}

.news-expanded {
  margin-top: 0.15rem;
}

.view-more-btn {
  margin-top: 0.5rem;
  border: 1px solid var(--view-more-border);
  background: var(--view-more-bg);
  color: var(--view-more-text);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.view-more-btn:hover {
  filter: brightness(0.98);
}

.theme-toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.theme-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.theme-toolbar__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--meta);
  white-space: nowrap;
}

.theme-toolbar__icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
}

.theme-icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Phase 4 S4 a11y: visual rectangle stays 2.35rem (≈ 38px) for
     desktop density but min-* lifts the hit area to the WCAG floor.
     Mobile override at the bottom of this file already used 48px. */
  width: 2.35rem;
  height: 2.35rem;
  min-width: var(--touch-target-min, 48px);
  min-height: var(--touch-target-min, 48px);
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.theme-icon-btn svg {
  flex-shrink: 0;
}

.theme-icon-btn:hover {
  background: var(--prefs-toggle-hover);
}

.theme-icon-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.theme-icon-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.tile-refresh-corner {
  pointer-events: none;
}

.tile-refresh-corner .tile-refresh-btn {
  pointer-events: auto;
}

/* Avoid intercepting Sortable drag moves that cross tile bodies */
.dashboard-tiles:has(.sortable-ghost) .tile-refresh-btn {
  pointer-events: none !important;
}

#commute-card.dashboard-tile--collapsed .tile-refresh-corner,
#tile-ipl.dashboard-tile--collapsed .tile-refresh-corner,
#currency-tile.dashboard-tile--collapsed .tile-refresh-corner {
  display: none;
}

.tile-refresh-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    opacity var(--duration-base) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.tile-refresh-btn:hover {
  background: var(--prefs-toggle-hover);
}

.tile-refresh-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.tile-refresh-btn:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
}

.tile-refresh-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tile-header-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.weather-hourly-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  padding: 0;
  margin: 0;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--surface-alt);
  color: var(--accent);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.18s ease;
}

.weather-hourly-toggle:hover {
  background: var(--prefs-toggle-hover);
  color: var(--text);
  border-color: var(--border);
}

.weather-hourly-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.weather-hourly-toggle__icon {
  display: block;
  transition: transform 0.2s ease;
}

.weather-hourly-toggle[aria-expanded="true"] .weather-hourly-toggle__icon {
  transform: rotate(180deg);
}

.hourly-forecast__caption {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}
