/* ShuDue on a computer: a laptop or desktop with a mouse or trackpad (body.desk, set by app.js; never in
   the iPhone/iPad app, never on an iPad or phone browser, which keep their own design untouched).
   It should feel like a desktop app rather than a stretched phone: a slimmer sidebar with the main
   actions in it, a compact title bar, panels that slide in from the right instead of covering the
   middle, two columns where there's room, hover states, and keyboard shortcuts (app.js). */

body.desk {
  --side: 232px;
  --rail: 340px;
  --desk-max: 1320px;
}

/* ---------- the page frame ---------- */
body.desk:not(.auth):not(.intro) #app {
  width: min(var(--desk-max), calc(100vw - var(--side) - 56px)); max-width: none;
  margin-left: calc(var(--side) + max(28px, (100vw - var(--side) - var(--desk-max)) / 2));
  padding: 22px 28px 60px 0;
}

/* a compact title bar: the page name and the date on one line, the buttons beside them */
body.desk .topbar { align-items: center; padding-bottom: 14px; margin-bottom: 18px; }
body.desk .topbar .hello { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
body.desk .topbar h1 { font-size: 34px; line-height: 1; order: 1; }
body.desk .topbar .hello small { order: 2; margin: 0; }
body.desk .topbar .icon-btn { width: 40px; height: 40px; }

/* ---------- the sidebar ---------- */
body.desk .tabbar { width: var(--side); padding: 20px 12px 16px; display: flex; flex-direction: column; }
body.desk .tabbar::before { font-size: 36px; margin: 0 8px 22px; padding: 26px 0 12px; }
body.desk .tab { padding: 9px 12px; font-size: 14.5px; gap: 12px; }
body.desk .tab svg { width: 19px; height: 19px; }
body.desk .tab kbd {
  margin-left: auto; font: 600 11px/1 system-ui, sans-serif; color: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .18); padding: 3px 5px; opacity: 0; transition: opacity .15s;
}
body.desk .tabbar:hover .tab kbd { opacity: 1; }
body.desk .tab.active kbd { color: rgba(20, 20, 20, .55); border-color: rgba(20, 20, 20, .25); }

/* the main action lives in the sidebar on a computer, not floating in the corner */
.desk-new { display: none; }
body.desk .desk-new {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 14px;
  background: var(--signal); color: #fff; border: 2px solid #000; box-shadow: 3px 3px 0 #000;
  font-weight: 800; font-size: 15px; cursor: pointer;
}
body.desk .desk-new:hover { filter: brightness(1.07); }
body.desk .desk-new:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
body.desk .desk-new kbd { margin-left: auto; font: 700 11px/1 system-ui, sans-serif; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .5); }
body.desk .fab { display: none; }

.desk-foot { display: none; }
body.desk .desk-foot {
  display: block; margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px; color: rgba(255, 255, 255, .5);
}
body.desk .desk-foot button { border: 0; background: none; color: inherit; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }
body.desk .desk-foot button:hover { color: #fff; }

/* ---------- panels: from the right, the page stays in view ---------- */
body.desk #sheet-root .sheet-backdrop { background: rgba(22, 21, 15, .18); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.desk #sheet-root .sheet,
body.desk #sheet-root.as-page .sheet {
  top: 0; bottom: 0; right: 0; left: auto; margin: 0;
  width: min(540px, calc(100vw - var(--side) - 40px)); max-width: none; max-height: none; height: 100vh;
  border: 0; border-left: 3px solid var(--ink); box-shadow: -14px 0 40px -20px rgba(0, 0, 0, .45);
  padding: 22px 26px 30px; opacity: 1;
  transform: translateX(104%); transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
body.desk #sheet-root.open .sheet { transform: none; }
body.desk .sheet-grip { display: none; }

/* ---------- things you can click look clickable ---------- */
body.desk [data-action]:not(input):not(select):not(textarea) { cursor: pointer; }
body.desk .task:hover, body.desk .cf-row:hover, body.desk .link-row:hover, body.desk .section-row:hover {
  outline: 2px solid var(--ink); outline-offset: -2px;
}
body.desk .section-row:hover { background: color-mix(in srgb, var(--sun) 12%, var(--surface-solid)); }
body.desk .tile:hover, body.desk .cf-tile:hover, body.desk .study-card:hover { transform: translate(-1px, -1px); }

/* thin scrollbars, like a desktop app */
body.desk * { scrollbar-width: thin; scrollbar-color: rgba(20, 20, 20, .3) transparent; }
body.desk ::-webkit-scrollbar { width: 10px; height: 10px; }
body.desk ::-webkit-scrollbar-thumb { background: rgba(20, 20, 20, .25); border: 2px solid transparent; background-clip: padding-box; }
body.desk ::-webkit-scrollbar-thumb:hover { background-color: rgba(20, 20, 20, .45); }

/* ---------- Schedule: search and tools on the left, the week on the right ---------- */
.sched-split, .sched-side, .sched-main { display: contents; }
body.desk .sched-split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0 26px; align-items: start; }
body.desk .sched-side, body.desk .sched-main { display: block; min-width: 0; }
body.desk .sched-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 2px 6px 16px 2px; }
body.desk .sched-side .sched-tools { grid-template-columns: repeat(4, 1fr); gap: 6px; }
body.desk .sched-side .sched-tools .tool-btn { padding: 9px 6px; font-size: 12.5px; }
body.desk .sched-side .seg.campus-seg button { padding: 8px 4px; font-size: 12.5px; }
body.desk .sched-side .search-line { grid-template-columns: 1fr; }
body.desk .sched-side .search-line .seg { justify-self: start; }
body.desk .sched-main .section-title { margin-top: 0 !important; }

/* ---------- the keyboard shortcuts list ---------- */
.kb-list { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: center; margin-top: 6px; }
.kb-list kbd {
  justify-self: start; font: 700 12px/1 system-ui, sans-serif; padding: 5px 8px; min-width: 26px; text-align: center;
  border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); background: var(--surface-solid);
}
.kb-list span { font-size: 14px; }
.kb-group { grid-column: 1 / -1; margin-top: 10px; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------- Notes on a computer ---------- */
/* the tools in a column down the left, so the page gets the whole height */
body.desk .nbx { display: grid; grid-template-columns: 124px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
body.desk .nbx > .nbx-bar { grid-column: 1 / -1; }
body.desk .nbx > .nbx-tools {
  grid-row: 2; grid-column: 1; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap;
  overflow-y: auto; overflow-x: hidden; padding: 10px 8px; gap: 10px; border-right: 2px solid var(--ink); border-bottom: 0; min-height: 0;
}
body.desk .nbx > .nbx-scroll { grid-row: 2; grid-column: 2; }
body.desk .nbx > .nbx-pageno { grid-column: 2; }
body.desk .nbx-tools .nbx-group { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px; margin: 0; padding: 0; border: 0; }
body.desk .nbx-tools .nbx-tool { display: flex; align-items: center; width: 100%; min-width: 0; justify-content: flex-start; gap: 7px; padding: 6px 6px; }
body.desk .nbx-tools .nbx-tool > span { width: 16px; text-align: center; flex: none; }
body.desk .nbx-tools .nbx-tool:hover:not(.on) { border-color: var(--line); }
body.desk .nbx-tools .nbx-tool small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.desk .nbx-tools .nbx-colors { display: grid; grid-template-columns: repeat(3, 22px); gap: 6px; justify-content: center; }
body.desk .nbx-tools .nbx-swatch { width: 22px; height: 22px; }
body.desk .nbx-tools .nbx-chip { width: 100%; white-space: normal; text-align: center; font-size: 11.5px; padding: 6px 4px; line-height: 1.2; }
body.desk .nbx-tools .nbx-hint { font-size: 11px; line-height: 1.35; white-space: normal; color: var(--muted); }
body.desk .nbx-tools .nbx-grow { flex: 1 0 8px; }
body.desk .nbx-tools [data-nb="pen-only"] { display: none; }   /* a mouse is never a finger */
