/* One shared surface; mobile only. Desktop keeps the original countdown node. */
.mobile-widget-stack { display: none; }
.mw-announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 768px) {
  body.dashboard-mobile-hero-active #pomodoro-widget-shell { display: none; }
  #view-dashboard .mobile-widget-stack {
    display: block; position: relative; isolation: isolate; min-width: 0; width: 100%;
    border: 1px solid color-mix(in srgb, var(--accent-blue) 22%, var(--border)); border-radius: 20px;
    background: var(--bg-card); color: var(--text-primary);
    box-shadow: 0 6px 20px #00000008, inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
  }
  .mw-viewport {
    display: flex; width: 100%; height: 136px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
    border-radius: 19px 19px 0 0; -webkit-overflow-scrolling: touch;
    /* Keep both native axes and pinch zoom available. No touch preventDefault. */
    touch-action: pan-x pan-y pinch-zoom;
  }
  .mw-viewport::-webkit-scrollbar { display: none; }
  .mw-page {
    box-sizing: border-box; flex: 0 0 100%; min-width: 0; height: 136px; padding: 12px 16px;
    scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden;
    contain: layout paint;
  }
  #view-dashboard .mw-clock { padding: 0; }
  #view-dashboard .mw-clock #exam-countdown {
    box-sizing: border-box; width: 100%; height: 100%; margin: 0; padding: 16px; justify-content: center;
    border: 0; border-radius: 19px 19px 0 0; box-shadow: none; gap: 10px;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  #view-dashboard .mw-clock .countdown-timer { width: 100%; }
  #view-dashboard .mw-clock .cd-item { padding: 5px 4px; }
  #view-dashboard .mw-clock .cd-item > span:first-child { font-size: clamp(26px, 7.5vw, 32px); }
  .mw-footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 28px; padding: 0 16px; border-top: 1px solid var(--border); }
  .mw-current-name, .mw-position { font-size: 9px; font-weight: 600; color: var(--text-secondary); line-height: 1.2; }
  .mw-position { text-align: right; font-variant-numeric: tabular-nums; }
  .mw-dots { display: flex; align-items: center; height: 28px; }
  .mw-dots button { position: relative; display: grid; place-items: center; width: 24px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
  .mw-dots button::before { content: ""; position: absolute; inset: -8px 0; }
  .mw-dots button span { width: 4px; height: 4px; border-radius: 5px; background: var(--text-secondary); opacity: .45; transition: width .22s ease, background .22s ease, opacity .22s ease; }
  .mw-dots button[aria-current] span { width: 17px; background: var(--accent-blue); opacity: 1; }
  .mobile-widget-stack button { font-family: inherit; -webkit-tap-highlight-color: transparent; }
  .mobile-widget-stack button:focus-visible, .mw-viewport:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: -3px; }
  .mw-title { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.2; letter-spacing: -.25px; }
  .mw-focus { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 6vw, 32px); }
  .mw-ring { position: relative; width: 108px; height: 108px; flex-shrink: 0; }
  .mw-ring > svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 4; }
  .mw-ring-track { stroke: color-mix(in srgb, var(--accent-green) 13%, transparent); }
  .mw-ring-progress { stroke: var(--accent-green); stroke-linecap: round; stroke-dasharray: 307.876; stroke-dashoffset: 307.876; transition: stroke-dashoffset .6s linear; }
  .mw-ring-copy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
  .mw-time { font-size: 25px; line-height: 1; font-weight: 750; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
  .mw-focus-copy { min-width: 0; }
  .mw-pomodoro-title { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; font-size: 18px; }
  .mw-pomodoro-title::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-green); opacity: 0; }
  .mw-controls { display: flex; align-items: center; gap: 6px; }
  .mw-controls button { display: grid; place-items: center; min-height: 40px; border: 0; border-radius: 12px; cursor: pointer; transition: transform .16s ease; }
  .mw-toggle { min-width: 85px; padding: 0 16px; background: var(--accent-green); color: var(--bg-card); font-size: 11px; font-weight: 750; }
  .mw-reset { width: 40px; padding: 9px; background: color-mix(in srgb, var(--text-primary) 6%, transparent); color: var(--text-secondary); }
  .mw-reset svg { width: 17px; height: 17px; }
  .mw-running .mw-active .mw-pomodoro-title::after { opacity: 1; animation: mw-breathe 2.4s ease-in-out infinite; }
  .mw-activity { display: flex; flex-direction: column; gap: 8px; }
  .mw-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; flex: 1; min-height: 0; }
  .mw-day { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
  .mw-bar-value { font-size: 8px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
  .mw-bar-track { display: flex; align-items: flex-end; width: 100%; max-width: 20px; min-height: 12px; flex: 1; overflow: hidden; border-radius: 4px; background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
  .mw-bar-fill { display: block; width: 100%; height: var(--bar-height); border-radius: inherit; background: color-mix(in srgb, var(--accent-blue) 48%, var(--bg-card)); transform-origin: bottom; }
  .mw-day-label { font-size: 9px; line-height: 1.2; color: var(--text-secondary); }
  .mw-today .mw-day-label { color: var(--accent-blue); font-weight: 800; }
  .mw-today .mw-bar-track { background: color-mix(in srgb, var(--accent-blue) 15%, transparent); }
  .mw-today .mw-bar-fill { background: var(--accent-blue); }
  .mw-shortcuts { display: flex; flex-direction: column; gap: 8px; }
  .mw-shortcut-grid { display: grid; flex: 1; min-height: 0; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1.2fr 1fr; gap: 6px; }
  .mw-shortcut { --shortcut-accent: var(--accent-blue); display: flex; align-items: center; gap: 8px; min-width: 0; padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--shortcut-accent) 13%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--shortcut-accent) 8%, transparent); color: var(--text-primary); text-align: left; cursor: pointer; transition: transform .16s ease, background .16s ease; }
  .mw-shortcut-topics { --shortcut-accent: var(--accent-green); }
  .mw-shortcut-stats { --shortcut-accent: var(--accent-purple); }
  .mw-shortcut-history { --shortcut-accent: var(--accent-orange); }
  .mw-shortcut svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--shortcut-accent); }
  .mw-shortcut span { min-width: 0; font-size: 10px; font-weight: 650; line-height: 1.25; }
  .mw-shortcut small { display: block; margin-top: 2px; font-size: 8px; font-weight: 400; color: var(--text-secondary); }
  .mw-shortcut:active, .mw-controls button:active { transform: scale(.96); }
  .mw-shortcut:active { background: color-mix(in srgb, var(--shortcut-accent) 18%, transparent); }
  .mw-notebook { display: flex; align-items: center; gap: 18px; }
  .mw-notebook-cover { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; flex: 0 0 76px; height: 102px; border: 1px solid color-mix(in srgb, var(--accent-orange) 25%, var(--border)); border-radius: 5px 13px 13px 5px; background: color-mix(in srgb, var(--accent-orange) 9%, transparent); color: var(--accent-orange); box-shadow: inset 5px 0 0 color-mix(in srgb, var(--accent-orange) 12%, transparent); }
  .mw-notebook-cover svg { width: 28px; height: 28px; }
  .mw-notebook-count { font-size: 20px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
  .mw-notebook-empty { color: var(--text-secondary); }
  .mw-notebook-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
  .mw-notebook-topic { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; color: var(--accent-orange); }
  .mw-notebook-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 11px; line-height: 1.35; color: var(--text-secondary); overflow-wrap: anywhere; }
  .mw-open-notebook { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--text-primary); text-align: left; font-size: 10px; font-weight: 700; cursor: pointer; }
  @keyframes mw-breathe { 50% { opacity: .35; } }
}
@media (max-width: 350px) {
  .mw-page { padding-inline: 12px; }
  .mw-focus { gap: 12px; }
  .mw-pomodoro-title { font-size: 16px; }
  .mw-shortcut { gap: 5px; padding-inline: 7px; }
  .mw-shortcut svg { width: 17px; height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-widget-stack *, .mobile-widget-stack *::before { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
