/* Overview v3 refinement. Functional selectors and bindings are unchanged. */
#overviewView.overview-dashboard {
  --ov-surface: #fff;
  --ov-soft: #f4f4f4;
  --ov-ink: #171717;
  --ov-body: #4d4d4d;
  --ov-muted: #8f8f8f;
  --ov-line: #ebebeb;
  --ov-accent: #00ed64;
  --ov-accent-deep: #00a849;
  --ov-accent-soft: #eafff2;
  --ov-danger: #d93036;
  --ov-danger-soft: #fff1f1;
  gap: 16px;
  color: var(--ov-ink);
}

body[data-theme="dark"] #overviewView.overview-dashboard {
  --ov-surface: #111512;
  --ov-soft: #191e1b;
  --ov-ink: #f2f5f3;
  --ov-body: #c1c8c4;
  --ov-muted: #89928d;
  --ov-line: #29302c;
  --ov-accent-soft: #0d2b18;
  --ov-danger: #ff7b80;
  --ov-danger-soft: #2b1719;
}

#overviewView .overview-top-grid {
  grid-template-columns: minmax(0, 1fr) 248px;
  gap: 16px;
}

#overviewView .overview-main-column { gap: 20px; }
#overviewView .overview-greeting,
#overviewView .overview-panel,
#overviewView .draw-panel {
  border-color: var(--ov-line);
  border-radius: 12px;
  background: var(--ov-surface);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .035);
}

#overviewView .overview-greeting {
  position: relative;
  overflow: hidden;
  padding: 28px 30px;
  background: var(--ov-surface);
}

#overviewView .overview-greeting::after,
#overviewView .draw-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 237, 100, .17), rgba(0, 237, 100, 0) 70%);
  pointer-events: none;
}

#overviewView .overview-greeting::after {
  top: -74px;
  right: -66px;
  width: 200px;
  height: 200px;
}

#overviewView .overview-greeting > * { position: relative; z-index: 1; }
#overviewView .overview-greeting h2 {
  margin: 6px 0 8px;
  color: var(--ov-ink);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -1.8px;
}

#overviewView .overview-greeting > p:last-child { color: var(--ov-body); line-height: 1.55; }
#overviewView .overview-heading { margin-bottom: 12px; }
#overviewView .overview-heading .eyebrow,
#overviewView .overview-greeting .eyebrow { color: var(--ov-muted); font-size: 10px; letter-spacing: .04em; }
#overviewView .overview-heading h3 { color: var(--ov-ink); font-weight: 600; }
#overviewView .overview-summary-cards { gap: 8px; }
#overviewView .overview-summary-card {
  min-height: 96px;
  padding: 14px 15px;
  gap: 6px;
  border-color: var(--ov-line);
  border-radius: 12px;
  background: var(--ov-surface);
  color: var(--ov-ink);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .025);
  transition: border-color .16s ease, background-color .16s ease;
}

#overviewView .overview-summary-card:hover {
  border-color: color-mix(in srgb, var(--ov-accent-deep) 42%, var(--ov-line));
  background: color-mix(in srgb, var(--ov-accent-soft) 48%, var(--ov-surface));
  transform: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .025);
}

#overviewView .overview-summary-card span { color: var(--ov-body); font-weight: 600; }
#overviewView .overview-summary-card b { color: var(--ov-ink); font-size: 30px; }
#overviewView .overview-summary-card small { color: var(--ov-muted); }
#overviewView .overview-summary-card.is-alert b { color: var(--ov-danger); }
#overviewView .overview-panel { padding: 20px; }
#overviewView .overview-content-grid { gap: 16px; }
#overviewView .overview-text-button {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--ov-line);
  border-radius: 6px;
  background: var(--ov-surface);
  color: var(--ov-body);
}

#overviewView .overview-text-button:hover { border-color: var(--ov-ink); color: var(--ov-ink); }
#overviewView .overview-row { border-color: var(--ov-line); }
#overviewView button.overview-row { color: var(--ov-ink); }
#overviewView button.overview-row:hover { background: var(--ov-soft); }
#overviewView .overview-row-main strong { color: var(--ov-ink); font-weight: 600; }
#overviewView .overview-row-main small,
#overviewView .overview-row-meta { color: var(--ov-muted); }
#overviewView .overview-task-check input { accent-color: var(--ov-accent); color-scheme: light; }
body[data-theme="dark"] #overviewView .overview-task-check input { color-scheme: dark; }
#overviewView .overview-due-pill,
#overviewView .overview-source-pill {
  border: 1px solid var(--ov-line);
  background: var(--ov-soft);
  color: var(--ov-body);
  font-style: normal;
}

#overviewView .overview-due-pill.overdue { background: var(--ov-danger-soft); color: var(--ov-danger); }
#overviewView .overview-segmented { border: 1px solid var(--ov-line); background: var(--ov-soft); }
#overviewView .overview-segmented button { color: var(--ov-muted); }
#overviewView .overview-segmented button.active {
  background: var(--ov-surface);
  color: var(--ov-ink);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
}

#overviewView .overview-empty { color: var(--ov-muted); }
#overviewView .overview-activity-row { border-color: var(--ov-line); }
#overviewView .overview-activity-avatar { background: var(--ov-accent-soft); color: var(--ov-accent-deep); }
#overviewView .overview-activity-row p { color: var(--ov-body); }
#overviewView .overview-activity-row p strong { color: var(--ov-ink); }
#overviewView .overview-activity-row time { color: var(--ov-muted); }
#overviewView .overview-quick-actions { gap: 8px; }
#overviewView .overview-quick-actions button {
  min-height: 64px;
  border-color: var(--ov-line);
  border-radius: 10px;
  background: var(--ov-surface);
  color: var(--ov-ink);
}

#overviewView .overview-quick-actions button:hover {
  border-color: var(--ov-accent-deep);
  background: var(--ov-accent-soft);
}

#overviewView .overview-quick-actions button > span {
  border-radius: 8px;
  background: var(--ov-accent-soft);
  color: var(--ov-accent-deep);
}

#overviewView .overview-quick-actions small { color: var(--ov-muted); }
#overviewView .draw-panel { min-height: 400px; overflow: hidden; background: var(--ov-surface); }
#overviewView .draw-panel::before { display: none; }
#overviewView .draw-panel::after {
  top: -70px;
  left: 50%;
  width: 210px;
  height: 190px;
  transform: translateX(-50%);
}

#overviewView .draw-panel-content { padding: 18px 16px 16px; }
#overviewView .draw-title { text-align: left; }
#overviewView .draw-title small,
#overviewView .draw-message,
#overviewView .draw-ranking-mini h4,
#overviewView .draw-rank-row { color: var(--ov-muted); }
#overviewView .draw-title h3,
#overviewView .draw-score strong { color: var(--ov-ink); }
#overviewView .draw-machine { min-height: 120px; }
#overviewView .draw-gauge {
  width: 34px;
  height: 118px;
  border: 1px solid var(--ov-line);
  background: var(--ov-soft);
  box-shadow: none;
}

#overviewView .draw-gauge-fill {
  background: linear-gradient(to top, var(--ov-accent-deep), var(--ov-accent));
  box-shadow: none;
}

#overviewView .draw-button {
  min-height: 40px;
  border-radius: 8px;
  background: var(--ov-accent);
  box-shadow: none;
}

#overviewView .draw-button:active,
#overviewView .draw-button.is-pressed { transform: none; box-shadow: none; }
#overviewView .draw-rank-row.is-me { background: var(--ov-accent-soft); color: var(--ov-ink); }
#overviewView .draw-ranking-all { color: var(--ov-accent-deep); }
body[data-theme="dark"] #overviewView :is(.overview-activity-avatar, .overview-quick-actions button > span, .draw-ranking-all) { color: #57f391; }

@media (max-width: 1120px) {
  #overviewView .overview-top-grid { grid-template-columns: minmax(0, 1fr) 228px; }
}

@media (max-width: 900px) {
  #overviewView .overview-top-grid,
  #overviewView .overview-content-grid { grid-template-columns: 1fr; }
}

/* Explicit mobile tokens prevent the old dark-only fallback. */
@media (max-width: 768px) {
  body:has(#mobileApp[data-mobile-section="overview"]) {
    --ov-canvas: #fafafa;
    --ov-surface: #fff;
    --ov-soft: #f3f3f3;
    --ov-ink: #171717;
    --ov-body: #4d4d4d;
    --ov-muted: #8f8f8f;
    --ov-line: #e8e8e8;
    --ov-accent: #00ed64;
    --ov-accent-deep: #00a849;
    --ov-accent-soft: #eafff2;
    --ov-danger: #d93036;
    background: var(--ov-canvas);
    color: var(--ov-ink);
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) {
    --ov-canvas: #0b0e0c;
    --ov-surface: #111512;
    --ov-soft: #191e1b;
    --ov-ink: #f2f5f3;
    --ov-body: #c1c8c4;
    --ov-muted: #89928d;
    --ov-line: #29302c;
    --ov-accent-soft: #0d2b18;
    --ov-danger: #ff7b80;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .main {
    padding: calc(82px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom));
    background: var(--ov-canvas);
    color: var(--ov-ink);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-topbar.mobile-v2 {
    min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid var(--ov-line);
    background: color-mix(in srgb, var(--ov-canvas) 94%, transparent);
    color: var(--ov-ink);
    backdrop-filter: blur(18px);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-topbar.mobile-v2 strong {
    color: var(--ov-ink);
    font-size: 26px;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: -1px;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-icon-btn {
    min-width: 58px;
    min-height: 40px;
    border: 1px solid var(--ov-line);
    border-radius: 6px;
    background: var(--ov-surface);
    color: var(--ov-body);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-tabbar.mobile-v2 {
    border-top: 1px solid var(--ov-line);
    background: color-mix(in srgb, var(--ov-surface) 96%, transparent);
    box-shadow: 0 -8px 26px rgba(0, 0, 0, .035);
    backdrop-filter: blur(18px);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-tab { color: var(--ov-muted); }
  body:has(#mobileApp[data-mobile-section="overview"]) .mobile-tab.active {
    background: var(--ov-accent-soft);
    color: var(--ov-accent-deep);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp.mobile-app {
    gap: 12px;
    color: var(--ov-ink);
  }

  #mobileApp .mobile-overview { gap: 12px; color: var(--ov-ink); }
  #mobileApp .mobile-overview-greeting,
  #mobileApp .mobile-overview-panel,
  #mobileApp .mobile-draw-card,
  #mobileApp .mobile-overview-summary button {
    border-color: var(--ov-line);
    border-radius: 12px;
    background: var(--ov-surface);
    color: var(--ov-ink);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .035);
  }

  #mobileApp .mobile-overview-greeting {
    position: relative;
    overflow: hidden;
    padding: 18px;
    background: var(--ov-surface);
  }

  #mobileApp .mobile-overview-greeting::after {
    content: "";
    position: absolute;
    top: -60px;
    right: -58px;
    width: 165px;
    height: 165px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 237, 100, .17), rgba(0, 237, 100, 0) 70%);
    pointer-events: none;
  }

  #mobileApp .mobile-overview-greeting > * { position: relative; z-index: 1; }
  #mobileApp .mobile-overview-greeting > span,
  #mobileApp .mobile-overview-panel header > span,
  #mobileApp .mobile-draw-card header > span {
    color: var(--ov-muted);
    font-size: 9px;
    letter-spacing: .06em;
  }

  #mobileApp .mobile-overview-greeting h2 {
    color: var(--ov-ink);
    font-size: 24px;
    font-weight: 600;
    line-height: 30px;
    letter-spacing: -1px;
  }

  #mobileApp .mobile-overview-greeting p { color: var(--ov-body); }
  #mobileApp .mobile-overview-summary button { min-height: 60px; padding: 12px 13px; }
  #mobileApp .mobile-overview-summary span { color: var(--ov-body); font-weight: 600; }
  #mobileApp .mobile-overview-summary b { color: var(--ov-ink); font-weight: 600; }
  #mobileApp .mobile-overview-panel { padding: 16px; }
  #mobileApp .mobile-overview-panel h3 { color: var(--ov-ink); font-weight: 600; }
  #mobileApp .mobile-overview-task,
  #mobileApp .mobile-overview-row { border-color: var(--ov-line); }
  #mobileApp .mobile-overview-task input { accent-color: var(--ov-accent); color-scheme: light; }
  body[data-theme="dark"] #mobileApp .mobile-overview-task input { color-scheme: dark; }
  #mobileApp .mobile-overview-task strong,
  #mobileApp .mobile-overview-row strong { color: var(--ov-ink); font-weight: 600; }
  #mobileApp .mobile-overview-task small,
  #mobileApp .mobile-overview-row small,
  #mobileApp .mobile-overview-row > b,
  #mobileApp .mobile-overview-empty { color: var(--ov-muted); }
  #mobileApp .mobile-overview-row { background: transparent; color: var(--ov-ink); }
  #mobileApp .mobile-overview-quick button {
    border-color: var(--ov-line);
    border-radius: 8px;
    background: var(--ov-surface);
    color: var(--ov-ink);
    font-weight: 600;
  }

  #mobileApp .mobile-overview-quick button:active {
    border-color: var(--ov-accent-deep);
    background: var(--ov-accent-soft);
  }

  #mobileApp .mobile-draw-card { gap: 10px; padding: 17px; background: var(--ov-surface); }
  #mobileApp .mobile-draw-card header { text-align: left; }
  #mobileApp .mobile-draw-card header h3 { color: var(--ov-ink); font-weight: 600; }
  #mobileApp .mobile-draw-gauge {
    width: 38px;
    height: 132px;
    border: 1px solid var(--ov-line);
    background: var(--ov-soft);
  }

  #mobileApp .mobile-draw-gauge i {
    background: linear-gradient(to top, var(--ov-accent-deep), var(--ov-accent));
  }

  #mobileApp .mobile-draw-machine strong { color: var(--ov-ink); font-size: 48px; font-weight: 600; }
  #mobileApp .mobile-draw-machine span,
  #mobileApp .mobile-draw-card > p,
  #mobileApp .mobile-draw-ranking > span,
  #mobileApp .mobile-draw-ranking small { color: var(--ov-muted); }
  #mobileApp .mobile-draw-card > button:not(.mobile-draw-ranking-button) {
    border-radius: 8px;
    background: var(--ov-accent);
    font-weight: 700;
  }

  #mobileApp .mobile-draw-card > em { color: var(--ov-danger); }
  #mobileApp .mobile-draw-ranking > span.is-me { background: var(--ov-accent-soft); color: var(--ov-ink); }
  #mobileApp .mobile-draw-ranking-button { color: var(--ov-accent-deep); }
  body[data-theme="dark"] #mobileApp .mobile-draw-ranking-button { color: #57f391; }
}

/* Mobile overview hardening: keep checkbox geometry and draw modal theme isolated. */
@media (max-width: 768px) {
  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task {
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task > input[type="checkbox"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-grid !important;
    place-content: center !important;
    align-self: center !important;
    flex: 0 0 20px !important;
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1.5px solid #8f8f8f !important;
    border-radius: 5px !important;
    background: var(--ov-surface) !important;
    color: var(--ov-ink) !important;
    box-shadow: none !important;
    color-scheme: light !important;
    transform: none !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task > input[type="checkbox"]::after {
    content: "" !important;
    width: 9px !important;
    height: 5px !important;
    border: 0 !important;
    border-left: 2px solid #041a0d !important;
    border-bottom: 2px solid #041a0d !important;
    background: transparent !important;
    transform: rotate(-45deg) scale(0) !important;
    transform-origin: center !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task > input[type="checkbox"]:checked {
    border-color: var(--ov-accent) !important;
    background: var(--ov-accent) !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task > input[type="checkbox"]:checked::after {
    transform: rotate(-45deg) scale(1) !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) #mobileApp .mobile-overview-task > input[type="checkbox"] {
    border-color: #66716b !important;
    background: #111512 !important;
    color-scheme: dark !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-modal {
    align-items: end !important;
    padding: 0 !important;
    background: rgba(23, 23, 23, .34) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card {
    width: 100% !important;
    max-height: min(78svh, 680px) !important;
    border: 1px solid #ebebeb !important;
    border-bottom: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    background: #ffffff !important;
    color: #171717 !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .12) !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header {
    align-items: flex-start !important;
    padding: 20px 20px 16px !important;
    border-bottom: 1px solid #ebebeb !important;
    background: #ffffff !important;
    color: #171717 !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header .eyebrow {
    color: #8f8f8f !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header h2 {
    color: #171717 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    letter-spacing: -.4px !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header p:last-child {
    color: #6f6f6f !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header button {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #ebebeb !important;
    border-radius: 50% !important;
    background: #f7f7f7 !important;
    color: #171717 !important;
    box-shadow: none !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list {
    max-height: calc(78svh - 116px) !important;
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom)) !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    color: #171717 !important;
    overscroll-behavior: contain;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article {
    min-height: 52px !important;
    border-bottom: 1px solid #ebebeb !important;
    background: transparent !important;
    color: #171717 !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article.is-me {
    border-bottom-color: transparent !important;
    background: #eafff2 !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article :is(b, span, strong) {
    color: #171717 !important;
  }

  body:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article.is-pending strong {
    color: #8f8f8f !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card,
  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header,
  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list {
    border-color: #29302c !important;
    background: #111512 !important;
    color: #f2f5f3 !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header h2,
  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article :is(b, span, strong) {
    color: #f2f5f3 !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header p:last-child,
  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header .eyebrow,
  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article.is-pending strong {
    color: #89928d !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-card header button {
    border-color: #29302c !important;
    background: #191e1b !important;
    color: #f2f5f3 !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article {
    border-bottom-color: #29302c !important;
  }

  body[data-theme="dark"]:has(#mobileApp[data-mobile-section="overview"]) .draw-ranking-list article.is-me {
    background: #0d2b18 !important;
  }
}

/* Desktop overview: align the draw card with the summary row. */
@media (min-width: 769px) {
  #overviewView .overview-top-grid {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    grid-template-areas:
      "greeting greeting"
      "summary draw";
    align-items: stretch;
    gap: 18px 16px;
  }

  #overviewView .overview-main-column {
    display: contents;
  }

  #overviewView .overview-greeting {
    grid-area: greeting;
  }

  #overviewView .overview-main-column > section[aria-labelledby="overviewSummaryTitle"] {
    grid-area: summary;
    min-width: 0;
  }

  #overviewView .draw-panel {
    grid-area: draw;
    align-self: stretch;
    min-height: 0;
    height: auto;
  }

  #overviewView .draw-panel-content {
    grid-template-columns: minmax(112px, .9fr) 88px minmax(138px, 1.2fr);
    grid-template-areas:
      "title machine action"
      "title machine message"
      "title machine more";
    grid-template-rows: auto 1fr auto;
    align-items: center;
    gap: 6px 10px;
    min-height: 100%;
    padding: 14px 16px;
  }

  #overviewView .draw-title {
    grid-area: title;
    align-self: start;
  }

  #overviewView .draw-title h3 {
    margin-top: 7px;
    font-size: 17px;
    line-height: 1.3;
  }

  #overviewView .draw-machine {
    grid-area: machine;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    min-height: 0;
    height: 78px;
  }

  #overviewView .draw-gauge {
    width: 22px;
    height: 78px;
    border-width: 1px;
    border-radius: 12px;
  }

  #overviewView .draw-gauge-fill {
    inset: 4px;
    border-radius: 8px;
  }

  #overviewView .draw-score strong {
    font-size: 34px;
  }

  #overviewView .draw-button {
    grid-area: action;
    align-self: end;
    min-height: 36px;
    border-radius: 7px;
  }

  #overviewView .draw-message {
    grid-area: message;
    display: -webkit-box;
    overflow: hidden;
    min-height: 0;
    margin: 0;
    color: var(--ov-muted);
    font-size: 9px;
    line-height: 1.4;
    text-align: left;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #overviewView .draw-error {
    grid-area: message;
    align-self: end;
    margin: 0;
    text-align: left;
  }

  #overviewView .draw-ranking-mini {
    display: none;
  }

  #overviewView .draw-ranking-all {
    grid-area: more;
    align-self: end;
    justify-self: end;
    min-height: 24px;
    padding: 0;
  }
}

@media (min-width: 769px) and (max-width: 1120px) {
  #overviewView .overview-top-grid {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  #overviewView .draw-panel-content {
    grid-template-columns: minmax(100px, .9fr) 80px minmax(120px, 1.1fr);
    padding-inline: 14px;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  #overviewView .overview-top-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "greeting"
      "summary"
      "draw";
  }
}

/* Compact horizontal daily draw card. Desktop only; mobile renderer is unchanged. */
@media (min-width: 769px) {
  #overviewView .draw-panel-content {
    grid-template-columns: minmax(0, 1.15fr) minmax(142px, .85fr);
    grid-template-areas:
      "title ranking"
      "machine ranking"
      "message ranking"
      "action more";
    grid-template-rows: auto auto minmax(24px, 1fr) auto;
    align-items: stretch;
    column-gap: 16px;
    row-gap: 5px;
  }

  #overviewView .draw-title h3 {
    margin-top: 4px;
    font-size: 16px;
  }

  #overviewView .draw-machine {
    grid-area: machine;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "score gauge";
    gap: 10px;
    min-height: 0;
    height: auto;
  }

  #overviewView .draw-gauge {
    grid-area: gauge;
    align-self: center;
    width: 100%;
    height: 14px;
    border-width: 1px;
    border-radius: 999px;
  }

  #overviewView .draw-gauge-fill {
    inset: 3px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--ov-accent-deep), var(--ov-accent));
    transform: scaleX(var(--draw-level, 0));
    transform-origin: left;
  }

  #overviewView .draw-panel.is-drawing .draw-gauge-fill {
    animation: drawPunchHorizontal 1.7s cubic-bezier(.18, .8, .25, 1) both;
  }

  #overviewView .draw-score {
    grid-area: score;
    display: flex;
    align-items: baseline;
    gap: 4px;
    text-align: left;
  }

  #overviewView .draw-score strong {
    font-size: 24px;
    letter-spacing: -.04em;
  }

  #overviewView .draw-score span {
    font-size: 9px;
    white-space: nowrap;
  }

  #overviewView .draw-button {
    grid-area: action;
    align-self: end;
    min-height: 32px;
  }

  #overviewView .draw-ranking-mini {
    grid-area: ranking;
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
    padding-left: 14px;
    border-left: 1px solid var(--ov-line);
  }

  #overviewView .draw-ranking-mini h4 {
    margin: 0 0 3px;
    color: var(--ov-body);
    font-size: 9px;
  }

  #overviewView .draw-rank-row {
    min-height: 25px;
    padding: 3px 5px;
    font-size: 9px;
  }

  #overviewView .draw-ranking-all {
    grid-area: more;
  }
}

@media (min-width: 769px) and (max-width: 1120px) {
  #overviewView .draw-panel-content {
    grid-template-columns: minmax(0, 1fr) minmax(132px, .86fr);
  }
}

@keyframes drawPunchHorizontal {
  0% { transform: scaleX(0); }
  48% { transform: scaleX(.99); }
  61% { transform: scaleX(.91); }
  70% { transform: scaleX(1); }
  79% { transform: scaleX(.94); }
  87% { transform: scaleX(.99); }
  100% { transform: scaleX(var(--draw-level)); }
}
