/* ======================================================================
   ShuDue — the design preview (body.ui-next). Switched on in Profile → "Try the new design".
   Same look (sharp boxes, black outlines, hard shadows, heavy type); it adds the feel: things press,
   spring and slide, and a study session built for phones and iPads. Nothing here applies without
   body.ui-next, so the current design is untouched.
   ====================================================================== */

/* ---------- 1. Everything you tap presses in ---------- */
body.ui-next :is(.btn, .icon-btn, .room-btn, .cf-tile, .cf-box, .leave-opt, .room-study-btn, .fx-chip, .fx-people, .chip, .seg button,
  .deck-card, .deck-filters button, .nbx-chip, .nbx-tool, .pr-show, .pr-grade, .fab, .desk-mbar button, .desk-mclock, .desk-more, .fv-btn) {
  transition: transform .16s cubic-bezier(.2, .9, .3, 1.25), box-shadow .16s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
body.ui-next :is(.btn, .icon-btn, .room-btn, .cf-tile, .cf-box, .leave-opt, .room-study-btn, .fx-chip, .fx-people, .chip, .fab, .desk-mclock, .desk-more):active {
  transform: translate(3px, 3px) scale(.985); box-shadow: 0 0 0 transparent !important; transition-duration: .06s;
}
body.ui-next :is(.seg button, .deck-filters button, .desk-mbar button, .nbx-chip):active { transform: scale(.94); transition-duration: .06s; }
@media (hover: hover) {
  body.ui-next :is(.btn:not(:disabled), .cf-tile, .cf-box, .room-study-btn, .fx-people):hover { transform: translate(-1px, -1px); }
}
/* the tab bar: the icon dips when you press it */
body.ui-next .tab .i, body.ui-next .tab svg { transition: transform .18s cubic-bezier(.3, 1.6, .5, 1); }
body.ui-next .tab:active .i, body.ui-next .tab:active svg { transform: scale(.82); }
/* ticking something off pops */
body.ui-next .item input[type=checkbox]:checked { animation: nx-pop .32s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes nx-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ---------- 2. Screens slide into each other ---------- */
body.ui-next .tabbar { view-transition-name: tabbar; }
::view-transition-old(root) { animation: .14s cubic-bezier(.4, 0, 1, 1) both nx-out; }
::view-transition-new(root) { animation: .3s cubic-bezier(.16, 1, .3, 1) both nx-in; }
@keyframes nx-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes nx-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- 3. Sheets spring up, toasts bounce in ---------- */
body.ui-next .sheet { transition: transform .42s cubic-bezier(.2, 1.2, .35, 1); }
body.ui-next .sheet-backdrop { transition: opacity .25s ease; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
@media (min-width: 1100px) {
  body.ui-next #sheet-root .sheet { transition: transform .34s cubic-bezier(.2, 1.3, .35, 1), opacity .16s ease; }
}
body.ui-next #toast { transition: opacity .18s ease, transform .4s cubic-bezier(.2, 1.5, .4, 1); }

/* ---------- 4. The study session: the focus screen ---------- */
body.ui-next .fx-hero {
  position: relative; display: grid; justify-items: center; gap: 10px; padding: 22px 18px 18px; margin-bottom: 14px;
  background: #2c3039; color: #f3f1ea; border: 3px solid #0d0e11; box-shadow: 6px 6px 0 #0d0e11; text-align: center;
  border-top: 6px solid var(--signal);
}
body.ui-next .fx-hero.resting { border-top-color: var(--mint); }
body.ui-next .fx-phase { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #a9a69c; }
body.ui-next .fx-phase span { color: var(--signal); }
body.ui-next .fx-hero.resting .fx-phase span { color: var(--mint); }
body.ui-next .fx-ring {
  position: relative; width: min(250px, 66vw); aspect-ratio: 1; padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent; transition: transform .18s cubic-bezier(.2, 1.4, .4, 1);
}
body.ui-next .fx-ring:active { transform: scale(.96); }
body.ui-next .fx-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
body.ui-next .fx-track { fill: none; stroke: #3a3f4a; stroke-width: 16; }
body.ui-next .fx-arc { fill: none; stroke: var(--signal); stroke-width: 16; transition: stroke-dashoffset 1s linear; }
body.ui-next .fx-hero.resting .fx-arc { stroke: var(--mint); }
body.ui-next .fx-hero.running .fx-arc { animation: nx-glow 2.4s ease-in-out infinite; }
@keyframes nx-glow { 50% { filter: drop-shadow(0 0 7px rgba(255, 90, 31, .55)); } }
body.ui-next .fx-hero.resting.running .fx-arc { animation-name: nx-glow-rest; }
@keyframes nx-glow-rest { 50% { filter: drop-shadow(0 0 7px rgba(16, 163, 107, .55)); } }
body.ui-next .fx-time { position: relative; margin-top: -14px; font-size: clamp(56px, 17vw, 76px); font-weight: 900; font-stretch: 72%; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
body.ui-next .fx-state {
  position: absolute; bottom: 24%; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: var(--sun); color: #141414; border: 2px solid #0d0e11; font-size: 13px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
}
body.ui-next .fx-hero.running .fx-state { background: #3a404c; color: #f3f1ea; }
body.ui-next .fx-meta { margin: 0; font-size: 13.5px; color: #c9c6bc; min-height: 1.2em; }
body.ui-next .fx-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
body.ui-next .fx-chip { min-height: 40px; padding: 0 14px; border: 2px solid #0d0e11; background: #3a404c; color: #f3f1ea; font-weight: 800; font-size: 14px; box-shadow: 3px 3px 0 #0d0e11; cursor: pointer; }
body.ui-next .fx-modes { display: flex; border: 2px solid #0d0e11; box-shadow: 3px 3px 0 #0d0e11; }
body.ui-next .fx-modes button { min-height: 36px; padding: 0 11px; border: 0; background: #3a404c; color: #c9c6bc; font-weight: 800; font-size: 13px; cursor: pointer; }
body.ui-next .fx-modes button + button { border-left: 2px solid #0d0e11; }
body.ui-next .fx-modes button.on { background: var(--sun); color: #141414; }
body.ui-next .fx-total { margin: 2px 0 0; font-size: 12.5px; font-weight: 700; color: #8f96a6; letter-spacing: .04em; }
body.ui-next .fx-people {
  justify-self: stretch; display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 12px; text-align: left;
  background: #23262d; color: #f3f1ea; border: 2px solid #0d0e11; box-shadow: 3px 3px 0 #0d0e11; cursor: pointer;
}
body.ui-next .fx-people > span:nth-child(2) { flex: 1; display: grid; }
body.ui-next .fx-people strong { font-size: 14.5px; }
body.ui-next .fx-people small { font-size: 12px; color: #a9a69c; }
body.ui-next .fx-faces { display: flex; }
body.ui-next .fx-faces i { width: 34px; height: 34px; margin-left: -8px; border-radius: 50%; border: 2px solid #0d0e11; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 14px; color: #141414; }
body.ui-next .fx-faces i:first-child { margin-left: 0; }

/* study tools: big, clear tiles */
body.ui-next .room-study-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
body.ui-next .room-study-btn { flex-direction: column; gap: 8px; min-height: 96px; padding: 14px; border-width: 2px; box-shadow: 4px 4px 0 #0d0e11; border-color: #0d0e11; }
body.ui-next .room-study-btn .i { width: 26px; height: 26px; color: var(--sun); }
body.ui-next .room-study-btn strong { font-size: 15px; line-height: 1.2; }
body.ui-next .room-study-btn:nth-child(2) .i { color: var(--signal); }
body.ui-next .room-study-btn:nth-child(3) .i { color: #8fd3ff; }
body.ui-next .room-study-btn:nth-child(4) .i { color: var(--mint); }
body.ui-next .room-card { border-width: 3px; box-shadow: 5px 5px 0 #0d0e11; }

/* phone desk header: the focus screen already shows the time, so the small clock only appears elsewhere */
@media (max-width: 699px) {
  body.ui-next .desk[data-mview="panel"][data-panel="session"] .desk-mclock { display: none; }
  body.ui-next .desk-top { padding-bottom: 10px; }
  body.ui-next .desk-title strong { font-size: 15.5px; }
  body.ui-next .desk-mbar { padding-top: 6px; }
  body.ui-next .desk-mbar button { border-radius: 0; }
  body.ui-next .desk-mbar button.on { color: #141414; }
  body.ui-next .desk-mbar button.on::before { top: 2px; bottom: 2px; left: 8%; right: 8%; height: auto; z-index: -1; background: var(--sun); border: 2px solid #0d0e11; box-shadow: 2px 2px 0 #0d0e11; }
  body.ui-next .desk-mbar button { z-index: 0; isolation: isolate; }
  body.ui-next .desk-right .desk-pbody { padding: 12px 12px 18px; }
}

/* ---------- 5. iPad: a real split screen (reader + focus column), folders slide in from the side ---------- */
@media (min-width: 700px) and (max-width: 1199px) {
  body.ui-next .desk-body { grid-template-columns: minmax(0, 1fr) 340px !important; position: relative; }
  body.ui-next .desk-left {
    display: block !important; visibility: visible !important; position: absolute; left: 0; top: 0; bottom: 0; width: 300px; z-index: 8;
    border-right: 3px solid #0d0e11; box-shadow: 10px 0 0 rgba(13, 14, 17, .55);
    transition: transform .3s cubic-bezier(.2, 1.1, .35, 1);
  }
  body.ui-next .desk.left-closed .desk-left { transform: translateX(-104%); box-shadow: none; }
  body.ui-next .desk-main { display: flex !important; grid-column: 1; }
  body.ui-next .desk-right { display: flex !important; grid-column: 2; border-left: 3px solid #181a1f; }
  body.ui-next .desk-fold { display: grid !important; z-index: 9; left: 300px; }
  body.ui-next .desk.left-closed .desk-fold { left: 0; }
  body.ui-next .desk-mbar { display: none !important; }
  body.ui-next .desk-ptabs { display: flex !important; }
  body.ui-next .desk-top .desk-clock, body.ui-next .desk-top .desk-play, body.ui-next .desk-top .desk-people, body.ui-next .desk-top .room-exit { display: flex !important; }
  body.ui-next .desk-top .desk-mclock, body.ui-next .desk-top .desk-more { display: none !important; }
  body.ui-next .desk-top { flex-wrap: nowrap; }
  body.ui-next .desk-play, body.ui-next .desk-people, body.ui-next .desk-top .room-exit { flex: none; min-height: 44px; }
  body.ui-next .desk[data-panel="session"] .desk-top .desk-clock { display: none !important; } /* the hero shows it */
  body.ui-next .fx-ring { width: 220px; }
  body.ui-next .room-study-btn { min-height: 84px; }
}
/* laptops: the same hero in the side column */
@media (min-width: 1200px) {
  body.ui-next .fx-ring { width: 230px; }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-next *, body.ui-next *::before, body.ui-next *::after { animation: none !important; transition-duration: .01ms !important; }
}
body.ui-next .fx-state .i, body.ui-next .fx-state svg { position: static; flex: none; width: 14px; height: 14px; margin: 0; }
/* the empty reader: the welcome card in the middle of the space, not stuck in a corner */
body.ui-next .dk-stage:has(> .dk-welcome) { display: grid; place-items: center; min-height: 100%; padding: 20px; }

/* ======================================================================
   6. The main screens, redesigned
   ====================================================================== */

/* header: today's date as a small label, a bigger title, tighter icon buttons */
body.ui-next .topbar { border-bottom-width: 3px; padding-bottom: 14px; margin-bottom: 18px; }
body.ui-next .hello small { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
body.ui-next .hello h1 { font-size: clamp(44px, 12vw, 64px); font-weight: 900; font-stretch: 70%; line-height: .9; letter-spacing: -.01em; text-transform: uppercase; }
body.ui-next .topbar .icon-btn { width: 44px; height: 44px; border-width: 2.5px; box-shadow: 3px 3px 0 var(--ink); }

/* the do-this-next hero */
body.ui-next .nx-hero {
  position: relative; display: grid; gap: 12px; padding: 16px 18px 18px; margin-bottom: 16px;
  background: #141414; color: #f3f1ea; border: 3px solid #141414; border-top: 8px solid var(--c);
  box-shadow: 8px 8px 0 var(--c);
  animation: nx-hero-in .5s cubic-bezier(.16, 1, .3, 1) both;
}
@keyframes nx-hero-in { from { opacity: 0; transform: translateY(14px); } }
body.ui-next .nx-hero.lvl-overdue { --c: var(--critical) !important; }
body.ui-next .nx-hero.is-clear { --c: var(--mint); }
body.ui-next .nx-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.ui-next .nx-eyebrow { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--sun); }
body.ui-next .nx-hero-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; }
body.ui-next .nx-hero-text { display: grid; gap: 6px; min-width: 0; }
body.ui-next .nx-course { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #a9a69c; font-weight: 700; }
body.ui-next .nx-tag { padding: 3px 8px; background: var(--c); color: #fff; font-size: 12px; font-weight: 900; letter-spacing: .06em; }
body.ui-next .nx-title { display: block; font-size: clamp(30px, 9vw, 42px); font-weight: 900; font-stretch: 76%; line-height: .95; letter-spacing: -.01em; overflow-wrap: anywhere; }
body.ui-next .nx-due { display: block; font-size: 14px; color: #c9c6bc; margin: 0; }
body.ui-next .nx-count { display: grid; justify-items: end; line-height: .85; }
body.ui-next .nx-count b { font-size: clamp(54px, 15vw, 72px); font-weight: 900; font-stretch: 66%; color: var(--sun); letter-spacing: -.02em; white-space: nowrap; }
body.ui-next .nx-hero.lvl-overdue .nx-count b { color: #ff8a7a; }
body.ui-next .nx-count small { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #a9a69c; margin-top: 6px; }
body.ui-next .nx-ready { height: 10px; background: #2c3039; border: 2px solid #000; }
body.ui-next .nx-ready span { display: block; height: 100%; width: var(--p); background: var(--sun); transition: width .6s cubic-bezier(.16, 1, .3, 1); }
body.ui-next .nx-ready-label { margin: -6px 0 0; font-size: 12px; font-weight: 800; color: #a9a69c; letter-spacing: .06em; }
body.ui-next .nx-hero-actions { display: flex; gap: 10px; margin-top: 2px; }
body.ui-next .nx-cta { flex: 1; min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2.5px solid #000; background: var(--sun); color: #141414; font-size: 17px; font-weight: 900; box-shadow: 4px 4px 0 #000; cursor: pointer; transition: transform .14s cubic-bezier(.2, .9, .3, 1.25), box-shadow .14s; }
body.ui-next .nx-cta:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }
body.ui-next .nx-ghost { min-height: 50px; padding: 0 18px; display: inline-flex; align-items: center; gap: 6px; border: 2.5px solid #4a4f5a; background: transparent; color: #f3f1ea; font-weight: 800; cursor: pointer; transition: transform .14s, border-color .15s, background .15s; }
body.ui-next .nx-ghost:active { transform: scale(.96); background: var(--mint); border-color: var(--mint); }

/* two tiles side by side instead of two full-width banners */
body.ui-next .nx-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
body.ui-next .nx-tile {
  display: grid; align-content: start; justify-items: start; gap: 4px; min-height: 108px; padding: 14px; text-align: left;
  border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); cursor: pointer; font: inherit;
  transition: transform .14s cubic-bezier(.2, .9, .3, 1.25), box-shadow .14s;
}
body.ui-next .nx-tile:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
body.ui-next .nx-tile .i { width: 24px; height: 24px; margin-bottom: 8px; }
body.ui-next .nx-tile strong { font-size: 18px; font-weight: 900; font-stretch: 86%; line-height: 1.05; }
body.ui-next .nx-tile small { font-size: 12.5px; line-height: 1.3; }
body.ui-next .nx-study { background: #141414; color: #f3f1ea; }
body.ui-next .nx-study .i { color: var(--sun); }
body.ui-next .nx-study small { color: #a9a69c; }
body.ui-next .nx-plan { background: var(--sun); color: #141414; }
body.ui-next .nx-plan.is-behind { background: var(--signal); color: #fff; }

/* the three numbers, as one bar you can tap to filter */
body.ui-next .nx-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 2.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); margin-bottom: 8px; }
body.ui-next .nx-stats button { display: grid; justify-items: start; gap: 2px; padding: 10px 14px; border: 0; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; transition: background .15s, color .15s; }
body.ui-next .nx-stats button + button { border-left: 2px solid var(--ink); }
body.ui-next .nx-stats b { font-size: 32px; font-weight: 900; font-stretch: 70%; line-height: 1; }
body.ui-next .nx-stats span { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
body.ui-next .nx-stats button.bad b { color: var(--critical); }
body.ui-next .nx-stats button.on { background: var(--ink); color: #fff; }
body.ui-next .nx-stats button.on span { color: var(--sun); }
body.ui-next .nx-listhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
body.ui-next .nx-listhead h2 { font-size: 30px; font-weight: 900; font-stretch: 70%; text-transform: uppercase; line-height: .9; }

/* task cards: cleaner, a bigger countdown, more room */
body.ui-next .task { padding: 14px 14px 14px 24px; border-width: 2.5px; box-shadow: 5px 5px 0 var(--ink); margin-bottom: 12px; }
body.ui-next .task::before { width: 10px; }
body.ui-next .task-title { font-size: 19px; font-stretch: 84%; font-weight: 900; }
body.ui-next .countdown { font-size: 26px; font-stretch: 68%; font-weight: 900; }
body.ui-next .status { font-size: 10.5px; letter-spacing: .06em; }
body.ui-next .check { width: 28px; height: 28px; border-width: 2.5px; transition: background .15s, transform .18s cubic-bezier(.3, 1.6, .5, 1); }
body.ui-next .check:active { transform: scale(.85); background: var(--mint); color: #fff; }

/* controls: chips, segmented buttons, inputs */
body.ui-next .chip-btn { border-width: 2px; border-color: var(--ink); font-weight: 700; min-height: 38px; }
body.ui-next .chip-btn.active { background: var(--ink); color: var(--sun); }
body.ui-next .seg { border-width: 2px; box-shadow: 3px 3px 0 var(--ink); }
body.ui-next .seg button { font-weight: 800; padding: 8px 14px; }
body.ui-next .seg button.active { background: var(--ink); color: var(--sun); }
body.ui-next :is(input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea) { border-width: 2px; border-color: var(--ink); }
body.ui-next :is(input, select, textarea):focus { outline: none; box-shadow: 4px 4px 0 var(--accent); }
body.ui-next .card { border-width: 2.5px; }
body.ui-next .btn { font-weight: 800; min-height: 44px; }

/* phones and iPads: the tab bar floats, like a dock */
@media (max-width: 1099px) {
  body.ui-next .tabbar {
    left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 4px;
    background: #141414; border: 3px solid #141414; box-shadow: 0 12px 28px rgba(20, 20, 20, .28), 5px 5px 0 var(--signal);
  }
  body.ui-next .tab { min-height: 54px; justify-content: center; color: #a9a69c; }
  body.ui-next .tab.active { background: var(--sun); color: #141414; }
  body.ui-next .tab.active::before { display: none; }
  body.ui-next #app { padding-bottom: calc(var(--tabbar-h) + max(10px, env(safe-area-inset-bottom)) + 110px); }
  body.ui-next .fab { bottom: calc(var(--tabbar-h) + max(10px, env(safe-area-inset-bottom)) + 26px); }
}
/* long titles (SCHEDULE) never run into the icon buttons */
body.ui-next .hello { flex: 1; min-width: 0; }
body.ui-next .hello h1 { font-size: clamp(36px, 10.5vw, 60px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
