/* ==========================================================================
   Foundations: Tokens, Reset, Page Bases
   ========================================================================== */

:root {
  --primary-container: #ff5f1f;
  --surface-variant: #f9dcd4;
  --surface-tint: #ab3600;
  --surface-container: #ffe9e3;
  --surface-container-lowest: #fff;
  --on-surface: #271813;
  --on-surface-variant: #5b4138;
  --outline-variant: #e3bfb3;
  --brutal-shadow: #3a3a3a;
  --brutal-shadow-soft: rgba(58, 58, 58, 0.62);
  --window-shadow: rgba(0, 0, 0, 0.7);
  --window-shadow-soft: rgba(0, 0, 0, 0.5);
  --border-width: 4px;
  --border-width-sm: 2px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-gutter: 16px;
  --font-body-sm: 14px;
  --font-label-mono: 12px;
  --font-headline-xl: 40px;
  --top-bar-height: 48px;
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M3 2l15 9-7 2-3 7z'/%3E%3Cpath fill='%23ff5f1f' d='M9 13l2 5-3 2z'/%3E%3C/svg%3E") 3 2, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23ff5f1f' stroke='%23000' stroke-width='2' d='M5 2h7v7h5v6h-5v7H5v-7H0V9h5z'/%3E%3C/svg%3E") 12 12, pointer;
  --cursor-move: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M7 11V7h4v4h1V5h4v6h1V7h4v8l-3 7H9l-4-6v-5z'/%3E%3Cpath fill='%23ff5f1f' stroke='%23000' stroke-width='2' d='M8 11h13v5H8z'/%3E%3C/svg%3E") 14 14, move;
  --cursor-resize-ew: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='20' viewBox='0 0 28 20'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M2 10l6-6v4h12V4l6 6-6 6v-4H8v4z'/%3E%3C/svg%3E") 14 10, ew-resize;
  --cursor-resize-ns: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='28' viewBox='0 0 20 28'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M10 2l6 6h-4v12h4l-6 6-6-6h4V8H4z'/%3E%3C/svg%3E") 10 14, ns-resize;
  --cursor-resize-nwse: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M4 4h9L9 8l11 11 4-4v9h-9l4-4L8 9l-4 4z'/%3E%3C/svg%3E") 14 14, nwse-resize;
  --cursor-resize-nesw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath fill='%23fff' stroke='%23000' stroke-width='2' d='M24 4v9l-4-4L9 20l4 4H4v-9l4 4L19 8l-4-4z'/%3E%3C/svg%3E") 14 14, nesw-resize;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--surface-variant);
  min-height: 100vh;
  cursor: var(--cursor-default);
}

body.login-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  overflow-y: auto;
  padding: calc(var(--spacing-gutter) + 8px) calc(var(--spacing-gutter) + 8px) 72px;
}

body.login-page .window {
  max-height: calc(100vh - 144px);
  margin-top: clamp(24px, 8vh, 80px);
  margin-bottom: 72px;
}

body.main-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

body.main-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms linear;
  z-index: 900;
}

body.main-page.focus-mode::before {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Theme: Main OS Night Mode
   ========================================================================== */

body.main-page.night-mode {
  --primary-container: #ff8a3d;
  --surface-variant: #17110f;
  --surface-tint: #ffb08a;
  --surface-container: #35231e;
  --surface-container-lowest: #100b0a;
  --on-surface: #ffe9e3;
  --on-surface-variant: #d7b9ae;
  --outline-variant: #6f524a;
  color: var(--on-surface);
  background: #17110f;
}

body.main-page.night-mode .workspace {
  background-color: #17110f;
  background-image:
    radial-gradient(rgba(255, 138, 61, 0.34) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255, 95, 31, 0.1), rgba(0, 157, 228, 0.08));
  background-size: 20px 20px, 100% 100%;
}

body.main-page.night-mode .top-bar {
  background: #211714;
  border-bottom-color: #ff8a3d;
  box-shadow: 0 4px 0 0 #000, 0 8px 0 0 rgba(255, 138, 61, 0.28);
}

body.main-page.night-mode .brand-logo {
  background: #ff8a3d;
  color: #100b0a;
  border-color: #000;
}

body.main-page.night-mode .top-nav a {
  color: #ffe9e3;
}

body.main-page.night-mode .top-nav a:hover,
body.main-page.night-mode .top-nav-menu:hover .top-nav-trigger:not(.top-nav-active) {
  background: #35231e;
  color: #fff;
  border-color: #ff8a3d;
  box-shadow: 3px 3px 0 0 #000;
}

body.main-page.night-mode .top-nav a.top-nav-active {
  background: #ff8a3d;
  color: #100b0a;
}

body.main-page.night-mode .top-nav-dropdown {
  background: #211714;
  border-color: #ff8a3d;
  box-shadow: 5px 5px 0 0 #000;
}

body.main-page.night-mode .top-nav-menu.menu-open .top-nav-dropdown {
  background: #35231e;
  box-shadow: inset 4px 4px 0 0 #000, 5px 5px 0 0 rgba(255, 138, 61, 0.42);
}

body.main-page.night-mode .top-nav-dropdown-item {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ff8a3d;
  box-shadow: 3px 3px 0 0 #000;
}

body.main-page.night-mode .top-nav-dropdown-item:hover {
  background: #35231e;
}

body.main-page.night-mode .top-nav-dropdown-item[aria-pressed="true"] {
  background: #ff8a3d;
  color: #100b0a;
}

body.main-page.night-mode .bottom-nav,
body.main-page.night-mode .datetime-display,
body.main-page.night-mode .icon-btn,
body.main-page.night-mode .user-avatar {
  background: #211714;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .bottom-nav {
  box-shadow: 4px 4px 0 0 #000, 7px 7px 0 0 rgba(255, 138, 61, 0.28);
}

body.main-page.night-mode .bottom-nav-toggle {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.72) 0 9px, rgba(255, 255, 255, 0.12) 10px 12px, transparent 13px),
    linear-gradient(145deg, #ffe9e3 0 18%, #5a4038 19% 46%, #100b0a 47% 100%);
  border-color: #ff8a3d;
  box-shadow: none;
}

body.main-page.night-mode .bottom-nav-item {
  color: #ffe9e3;
}

body.main-page.night-mode .bottom-nav-item:hover {
  background: #35231e;
  border-color: #ff8a3d;
}

body.main-page.night-mode .bottom-nav-item.active {
  background: #ff8a3d;
  color: #100b0a;
  border-color: #000;
}

/* ==========================================================================
   Pages: Non-Main Shared Header
   ========================================================================== */

/* Regular header for non-login pages */
body:not(.main-page) header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  height: var(--top-bar-height);
  background-color: black;
  color: white;
  border-bottom: var(--border-width) solid black;
}

/* ==========================================================================
   Core Shell: Top Bar
   ========================================================================== */

/* Main page top bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 var(--spacing-md);
  height: var(--top-bar-height);
  background-color: #F0F0F0;
  border-bottom: 2px solid #000;
  box-shadow: 0 4px 0 0 rgba(0, 0, 0, 1);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.brand-logo {
  background-color: black;
  color: white;
  padding: 4px 12px;
  font-size: 18px;
  font-weight: 900;
  border: 2px solid #000;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  border-right-width: 4px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.top-nav-menu {
  position: relative;
}

.top-nav-menu.menu-open {
  z-index: 1210;
}

.top-nav-menu:hover {
  z-index: 1220;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  color: black;
  text-decoration: none;
  font-weight: 700;
  font-size: calc(var(--font-body-sm) * 1.25);
  text-transform: uppercase;
  padding: 3px 8px;
  border: 2px solid transparent;
  transition: background-color 0.08s linear, color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear, border-color 0.08s linear;
  border-radius: 0;
}

.top-nav a:hover,
.top-nav-menu:hover .top-nav-trigger:not(.top-nav-active) {
  background-color: var(--surface-container);
  color: #000;
  border-color: #000;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav a:not(.top-nav-active):active,
.top-nav-menu:hover .top-nav-trigger:not(.top-nav-active):active {
  background-color: var(--surface-container);
  color: #000;
  border-color: #000;
  transform: translate(1px, 1px);
  box-shadow: inset 2px 2px 0 0 #000;
}

.top-nav a.top-nav-active {
  background-color: var(--primary-container);
  color: #000;
  border-color: #000;
  transform: translate(1px, 1px);
  box-shadow: inset 2px 2px 0 0 #000;
}

.top-nav a.top-nav-active:hover {
  background-color: var(--primary-container);
  color: #000;
  border-color: #000;
  transform: translate(-1px, -1px);
  box-shadow: inset 2px 2px 0 0 #000, 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav-dropdown::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}

.top-nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 168px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-container);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 rgba(58, 58, 58, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 80ms linear, box-shadow 80ms linear, background-color 80ms linear;
  z-index: 1200;
}

.top-nav-menu:hover .top-nav-dropdown,
.top-nav-menu.menu-open .top-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
}

.top-nav-menu.menu-open .top-nav-dropdown {
  background: var(--primary-container);
  box-shadow: inset 4px 4px 0 0 #000;
}

.top-nav-dropdown-item {
  width: 100%;
  padding: 8px 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  cursor: var(--cursor-pointer);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transform: translate(-2px, -2px);
  transition: background-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.top-nav-menu.menu-open .top-nav-dropdown-item {
  transform: translate(0, 0);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav-dropdown-item:hover {
  background: var(--surface-container);
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
}

.top-nav-menu.menu-open .top-nav-dropdown-item:hover {
  background: var(--surface-container);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.top-nav-dropdown-item:active {
  background: var(--primary-container);
  transform: translate(1px, 1px);
  box-shadow: none;
}

.top-nav-dropdown-item[aria-pressed="true"] {
  background: var(--primary-container);
  box-shadow: inset 3px 3px 0 0 #000;
  transform: translate(1px, 1px);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  overflow: visible;
}

.clock-control {
  position: relative;
  display: flex;
  align-items: center;
}

.datetime-display {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  height: 32px;
  min-width: 172px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-sm);
  border: 2px solid #000;
  border-radius: 0;
  background-color: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 0 #000;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transform-origin: right center;
  transition:
    transform 110ms cubic-bezier(0.2, 0, 0, 1),
    opacity 70ms linear;
  will-change: transform, opacity;
}

.datetime-display.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.datetime-display .time {
  color: var(--primary-container);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-width-sm) solid black;
  background-color: white;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  transition: all 0.1s;
}

.icon-btn:hover {
  background-color: var(--surface-variant);
}

.icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 1);
}

.profile-control {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border: var(--border-width-sm) solid black;
  background-color: var(--surface-container);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  transition: background-color 0.1s;
}

.user-avatar:hover {
  background-color: var(--surface-variant);
}

.user-avatar:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 1);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface-container-lowest);
  border: 3px solid #000;
  box-shadow: 6px 6px 0 0 #000;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.08s linear, transform 0.08s linear, visibility 0.08s linear;
  z-index: 1300;
}

.profile-control:hover .profile-menu {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.profile-control.menu-suppressed .profile-menu {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-6px);
}

.profile-menu::before {
  content: "";
  position: absolute;
  top: -13px;
  right: 0;
  width: 72px;
  height: 13px;
}

.profile-menu-user {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: var(--surface-container);
  border: 2px solid #000;
}

.profile-menu-storage {
  display: grid;
  grid-template-columns: 28px 1fr 30px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #cae6ff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 #000;
}

.profile-menu-storage > .material-symbols-outlined {
  font-size: 22px;
  color: #00304a;
}

.profile-menu-storage strong,
.profile-menu-storage small {
  display: block;
  min-width: 0;
}

.profile-menu-storage strong {
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.profile-menu-storage small {
  margin-top: 2px;
  color: var(--on-surface-variant);
  font-size: 10px;
  font-weight: 800;
}

.profile-storage-refresh {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 0 #000;
  cursor: var(--cursor-pointer);
}

.profile-storage-refresh:hover {
  background: var(--surface-container);
}

.profile-storage-refresh:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 0 #000;
}

.profile-storage-refresh .material-symbols-outlined {
  font-size: 18px;
}

.profile-menu-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-container);
  color: #fff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 #000;
  font-size: 14px;
  font-weight: 900;
}

.profile-menu-user strong,
.profile-menu-user small {
  display: block;
  min-width: 0;
}

.profile-menu-user strong {
  font-size: 13px;
  line-height: 1.1;
  text-transform: uppercase;
}

.profile-menu-user small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--on-surface-variant);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-item {
  min-height: 34px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--on-surface);
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear;
}

.profile-menu-item:hover {
  background: var(--surface-container);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #000;
}

.profile-menu-item:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #000;
}

.profile-menu-item-danger {
  color: #93000a;
}

.profile-menu-item .material-symbols-outlined {
  font-size: 18px;
}

.brand {
  font-size: var(--font-label-mono);
  font-weight: 700;
  color: white;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

nav ul {
  display: flex;
  gap: var(--spacing-lg);
  list-style: none;
}

nav a {
  color: var(--outline-variant);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--font-body-sm);
}

nav a:hover {
  color: white;
}

nav a[aria-current="page"] {
  color: white;
  text-decoration: underline;
}

/* ==========================================================================
   Core Shell: Desktop Workspace
   ========================================================================== */

/* Regular main for non-login pages */
body:not(.main-page) main {
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 var(--spacing-lg);
}

/* Main page workspace */
.workspace {
  flex: 1;
  position: relative;
  padding: var(--spacing-gutter);
  overflow: hidden;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 20px 20px;
}

/* ==========================================================================
   Widgets: Sticky Notes and Notebook Binding
   ========================================================================== */

.sticky-note {
  position: absolute;
  top: 40px;
  left: 48px;
  width: 260px;
  height: 236px;
  min-width: 180px;
  min-height: 164px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff1a8;
  box-shadow: 6px 6px 0 0 var(--note-shadow, #c49a00);
  color: #000;
  display: flex;
  flex-direction: column;
  user-select: none;
  cursor: var(--cursor-default);
  transform: translate(0, 0);
  transition: filter 0.12s linear, transform 0.12s linear, box-shadow 0.12s linear;
  will-change: filter, transform, box-shadow;
}

.sticky-note.is-active {
  box-shadow: 10px 10px 0 0 var(--note-shadow, #c49a00);
  filter: none;
  transform: translate(-3px, -3px);
  z-index: 80;
}

.sticky-note.is-inactive {
  box-shadow: 3px 3px 0 0 var(--note-shadow, #c49a00);
  filter: brightness(1.12) saturate(0.78);
  transform: translate(2px, 2px);
  z-index: 10;
}

.sticky-note.dragging {
  z-index: 120;
  opacity: 0.92;
}

.sticky-note.merge-target {
  outline: 4px solid var(--primary-container);
  outline-offset: 6px;
  box-shadow: 10px 10px 0 0 #000, 0 0 0 6px #fff;
}

.sticky-note.binding {
  overflow: visible;
  z-index: 140;
}

.sticky-note.bound-file {
  background: #8b4513;
  border-color: #000;
  border-width: 3px;
  color: #fff;
  box-shadow: 6px 6px 0 0 #000;
  overflow: visible;
}

.sticky-note.bound-file.is-active {
  box-shadow: 12px 12px 0 0 #000, inset 4px 4px 0 0 rgba(255, 255, 255, 0.16), inset -5px -5px 0 0 rgba(0, 0, 0, 0.22);
  filter: none;
}

.sticky-note.bound-file.is-inactive {
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.62), inset 3px 3px 0 0 rgba(255, 255, 255, 0.24);
  filter: brightness(1.24) saturate(0.72);
}

.sticky-note.bound-file::before,
.sticky-note.bound-file::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.sticky-note.bound-file::before {
  display: none;
}

.sticky-note.bound-file::after {
  display: none;
}

.sticky-note.binding-top {
  z-index: 130;
  transition:
    left 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    top 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    width 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    height 0.3s cubic-bezier(0.2, 0.9, 0.3, 1),
    box-shadow 0.3s ease;
}

.punched-holes {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 10px;
  width: 14px;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.punched-hole {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #0a0a0a 0 5px, #2a2a2a 5px 6px, transparent 6px);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.1),
    1px 2px 0 rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0);
  animation: hole-punch 0.22s cubic-bezier(0.3, 1.4, 0.5, 1) forwards;
}

@keyframes hole-punch {
  0% { opacity: 0; transform: scale(0); }
  70% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 1; transform: scale(1); }
}

.binding-spiral {
  position: absolute;
  top: 22.5px;
  bottom: 22.5px;
  left: -13.5px;
  width: 36px;
  z-index: 180;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sticky-note.binding .punched-holes {
  z-index: 20;
}

.sticky-note.binding .binding-spiral {
  z-index: 220;
}

.spiral-loop {
  width: 36px;
  height: 9px;
  border: 2px solid #000;
  border-radius: 4px;
  background: linear-gradient(180deg, #f5f5f5 0 50%, #8a8a8a 50% 100%);
  opacity: 0;
  transform: translateX(16px) rotate(200deg) scale(0.3);
  animation: spiral-wind 0.44s cubic-bezier(0.25, 1, 0.45, 1) forwards;
}

@keyframes spiral-wind {
  0% {
    opacity: 0;
    transform: translateX(16px) rotate(200deg) scale(0.3);
  }

  55% {
    opacity: 1;
    transform: translateX(-4px) rotate(20deg) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

.sticky-note-header {
  height: 32px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-sm);
  border-bottom: 2px solid #000;
  background: #ffdc4a;
  font-size: var(--font-label-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: var(--cursor-move);
}

.sticky-note-header .material-symbols-outlined {
  font-size: 18px;
}

.sticky-note-title {
  min-width: 0;
  flex: 1;
}

.sticky-note-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #d50000;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 0 #ab3600;
  cursor: var(--cursor-pointer);
  transition: background-color 0.08s linear, color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.sticky-note-close:hover {
  background: #ffe9e3;
  color: #d50000;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 #ab3600;
}

.sticky-note-close:active {
  background: #b00000;
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 0 #ab3600;
}

.sticky-note-close .material-symbols-outlined {
  font-size: 16px;
}

.sticky-note.bound-file .sticky-note-header {
  background: transparent;
  color: #fff;
  border-bottom: 2px solid #000;
  padding-left: 36px;
  padding-right: 24px;
}

.sticky-note.bound-file .sticky-note-body {
  margin: 0;
  padding: 18px 24px 18px 36px;
  background: transparent;
  color: #000;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow: hidden;
}

.sticky-note.bound-file .sticky-note-body h2 {
  display: block;
  background: #fff;
  border: 3px solid #000;
  padding: 10px 16px;
  margin: 8px 0 0;
  width: 78%;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.06em;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.18);
}

.sticky-note.bound-file .notebook-page-count {
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #000;
  background: rgba(255, 255, 255, 0.45);
  padding: 4px 10px;
  border: 2px solid #000;
  border-radius: 999px;
  margin: 0;
}

.sticky-note.bound-file .sticky-note-footer {
  background: transparent;
  color: #fff;
  border-top: 2px solid #000;
  padding-left: 36px;
  padding-right: 24px;
}

.sticky-note.bound-file .binding-spiral {
  top: 22.5px;
  bottom: 22.5px;
  left: -13.5px;
  width: 36px;
  z-index: 180;
}

.notebook-markers {
  position: absolute;
  top: 44px;
  bottom: 20px;
  right: -16px;
  width: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  pointer-events: auto;
}

.notebook-marker {
  flex: 0 1 42px;
  min-height: 22px;
  background: var(--marker-color, #fff1a8);
  border: 2px solid #000;
  border-left: none;
  border-radius: 0 6px 6px 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
  cursor: grab;
  transition: transform 0.18s cubic-bezier(0.25, 1, 0.45, 1);
}

.notebook-marker:hover {
  transform: translateX(4px);
}

.notebook-marker.dragging {
  cursor: grabbing;
  z-index: 40;
  transform: scale(1.08) translateX(6px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.4);
}

.sticky-note-body {
  flex: 1;
  min-height: 0;
  padding: var(--spacing-md);
  overflow: hidden;
}

.sticky-note-body h2 {
  margin-bottom: var(--spacing-sm);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.sticky-note-body p {
  font-size: var(--font-body-sm);
  font-weight: 500;
}

.sticky-note [contenteditable="true"] {
  cursor: text;
  outline: none;
  user-select: text;
}

.sticky-note [contenteditable="true"]:focus {
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 2px 2px 0 0 #000;
}

.sticky-note-footer {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm);
  border-top: 2px solid #000;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ==========================================================================
   Core Shell: Desktop Context Menu
   ========================================================================== */

/* Context menu */
.context-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 216px;
  display: none;
  flex-direction: column;
  padding: 4px;
  border: 2px solid #000;
  border-radius: 0;
  background: #F0F0F0;
  color: #000;
  box-shadow: 4px 4px 0 0 #000;
  z-index: 2000;
}

.context-menu.visible {
  display: flex;
}

.context-menu-item {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0 var(--spacing-sm);
  border: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #000;
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--font-label-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.context-menu-item:hover,
.context-menu-item:focus-visible {
  border-color: #000;
  background: var(--surface-container);
  outline: none;
}

.context-menu-item:active {
  background: var(--primary-container);
  color: #fff;
  box-shadow: inset 2px 2px 0 0 #000;
}

.context-menu-item .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20;
}

.context-menu-separator {
  height: 2px;
  margin: 4px 2px;
  background: #000;
}

.note-limit-alert {
  position: fixed;
  right: 24px;
  top: calc(var(--top-bar-height) + 18px);
  z-index: 2200;
  width: min(360px, calc(100vw - 48px));
  min-height: 104px;
  padding: 16px 18px 16px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #ffd6e7;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 0 #ff5f1f;
  color: #000;
  transform: translateX(calc(100% + 48px));
  pointer-events: none;
  opacity: 0;
}

.note-limit-alert.is-visible {
  animation: note-limit-rubber-band 0.92s cubic-bezier(0.18, 0.9, 0.2, 1.18) both;
  opacity: 1;
}

.note-limit-alert-mark {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff5f1f;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 0 #ab3600;
  color: #fff;
  font-size: 46px;
  line-height: 1;
  font-weight: 900;
}

.note-limit-alert-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-limit-alert-content strong {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.note-limit-alert-content span {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

@keyframes note-limit-rubber-band {
  0% {
    transform: translateX(calc(100% + 48px));
  }
  54% {
    transform: translateX(-16px);
  }
  66% {
    transform: translateX(14px);
  }
  78% {
    transform: translateX(-8px);
  }
  88% {
    transform: translateX(4px);
  }
  100% {
    transform: translateX(0);
  }
}

/* ==========================================================================
   Page: Sign In
   ========================================================================== */

/* Login-specific styles */
.window {
  width: 100%;
  max-width: 448px;
  background-color: white;
  border: var(--border-width) solid black;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 8px 8px 0 0 #000;
}

.window-header {
  background-color: black;
  color: white;
  height: var(--top-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-md);
  border-bottom: var(--border-width) solid black;
  flex-shrink: 0;
}

.header-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.header-title .material-symbols-outlined {
  font-size: 18px;
}

.header-title span:last-child {
  font-size: var(--font-label-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.content-area {
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  background-image: url(https://placeholder.pics/svg/300);
  background-size: cover;
  background-position: center;
  overflow: auto;
}

.inner-content {
  background-color: rgba(255, 255, 255, 0.9);
  padding: var(--spacing-lg);
  border: var(--border-width-sm) solid black;
  backdrop-filter: blur(4px);
}

.branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.logo {
  background-color: black;
  color: white;
  padding: 4px 12px;
  font-size: var(--font-headline-xl);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  border: var(--border-width) solid black;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
}

.subtitle {
  font-size: var(--font-body-sm);
  font-weight: 500;
  line-height: 1.4;
  color: var(--on-surface-variant);
  text-align: center;
  margin-top: var(--spacing-sm);
}

.form-container {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.form-container [hidden] {
  display: none !important;
}

.form-container[data-auth-form="signup"] {
  gap: var(--spacing-sm);
}

.form-container[data-auth-form="signup"] .actions {
  margin-top: var(--spacing-sm);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.input-label {
  font-size: var(--font-label-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.input-label .material-symbols-outlined {
  font-size: 14px;
}

.input-label small {
  margin-left: auto;
  color: var(--on-surface-variant);
  font-size: 9px;
  font-weight: 700;
}

.input-field {
  height: 48px;
  border: var(--border-width-sm) solid black;
  background-color: var(--surface-container-lowest);
  font-size: var(--font-body-sm);
  font-weight: 500;
  font-family: "Space Grotesk", sans-serif;
  padding: 0 var(--spacing-md);
  color: var(--on-surface);
  width: 100%;
  box-shadow: inset 4px 4px 0 0 rgba(0, 0, 0, 1);
  outline: none;
  transition: border-color 0.2s;
}

.input-field::placeholder {
  color: var(--outline-variant);
}

.input-field:focus {
  border-color: var(--primary-container);
}

.recover-link-container {
  display: flex;
  justify-content: flex-end;
  margin-top: -4px;
}

.recover-link {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.recover-link:hover {
  color: var(--primary-container);
}

.remember-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: 4px;
}

.checkbox-wrapper {
  position: relative;
  width: 20px;
  height: 20px;
}

.checkbox-input {
  appearance: none;
  width: 20px;
  height: 20px;
  border: var(--border-width-sm) solid black;
  background-color: white;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
}

.checkbox-input:checked {
  background-color: #ff6b00;
  box-shadow: 4px 4px 0 0 #ff6b00;
}

.checkbox-icon {
  position: absolute;
  top: 0;
  left: 0;
  color: black;
  font-size: 20px;
  pointer-events: none;
  display: none;
}

.checkbox-input:checked ~ .checkbox-icon {
  display: block;
}

.remember-label {
  font-size: var(--font-body-sm);
  font-weight: 500;
  color: var(--on-surface);
  cursor: pointer;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.btn {
  height: 48px;
  width: 100%;
  border: var(--border-width-sm) solid black;
  font-size: var(--font-label-mono);
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.1s;
}

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.btn-primary {
  background-color: var(--primary-container);
  color: white;
}

.btn-primary:hover {
  background-color: var(--surface-tint);
}

.btn-secondary {
  background-color: white;
  color: var(--on-surface);
}

.btn-secondary:hover {
  background-color: var(--surface-container);
}

.footer {
  margin-top: auto;
  border-top: var(--border-width-sm) solid black;
  padding-top: var(--spacing-sm);
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 8px;
}

.version-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.version-dot {
  width: 8px;
  height: 8px;
  background-color: black;
}

.version-text {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--on-surface-variant);
  text-transform: uppercase;
}

/* Bottom navigation */
/* ==========================================================================
   Core Shell: Bottom Bar and Floating Bottom-Bar Toggle
   ========================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: calc(100% + 40px) 50%;
  height: 72px;
  background: #F0F0F0;
  border: 2px solid #000000;
  display: flex;
  justify-content: center;
  align-items: stretch;
  padding: 4px;
  z-index: 1000;
  box-shadow: 4px 4px 0px 0px #000000;
  transition:
    transform 110ms cubic-bezier(0.2, 0, 0, 1),
    opacity 70ms linear;
  will-change: transform, opacity;
}

body.bottom-nav-minimized .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 64px)) rotate(-11deg);
}

body.focus-mode .bottom-nav {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 32px));
}

.bottom-nav-toggle {
  position: fixed;
  bottom: 30px;
  left: calc(50% + 404px);
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 3px solid #000;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.95) 0 9px, rgba(255, 255, 255, 0.2) 10px 12px, transparent 13px),
    linear-gradient(145deg, #ffffff 0 18%, #d4d4d4 19% 46%, #8b8b8b 47% 100%);
  box-shadow: none;
  cursor: var(--cursor-pointer);
  transform: none;
  transition: box-shadow 0.12s linear;
  z-index: 1010;
}

.bottom-nav-toggle-light {
  width: 31px;
  height: 31px;
  display: block;
  border: 3px solid #000;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 58%, #ff8a3d 0 45%, #d50000 46% 100%);
  box-shadow:
    4px 4px 0 0 #000,
    inset 3px 3px 0 0 rgba(255, 255, 255, 0.34),
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.36);
  transform: translate(-4px, -4px);
  transition: transform 0.12s linear, box-shadow 0.12s linear, background 0.12s linear;
}

.bottom-nav-toggle[aria-pressed="true"] {
  box-shadow: none;
}

.bottom-nav-toggle[aria-pressed="true"] .bottom-nav-toggle-light {
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.82) 0 6px, transparent 7px),
    radial-gradient(circle at 50% 58%, #20e08a 0 45%, #007a3d 46% 100%);
  box-shadow:
    1px 1px 0 0 #000,
    inset 3px 3px 0 0 rgba(0, 0, 0, 0.24),
    inset -3px -3px 0 0 rgba(255, 255, 255, 0.22);
  transform: translate(1px, 1px);
}

.bottom-nav-toggle:active {
  box-shadow: none;
}

.bottom-nav-toggle:active .bottom-nav-toggle-light {
  transform: translate(5px, 5px);
  box-shadow:
    1px 1px 0 0 #000,
    inset 4px 4px 0 0 rgba(0, 0, 0, 0.36),
    inset -2px -2px 0 0 rgba(255, 255, 255, 0.2);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.08s linear, color 0.08s linear, border-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
  color: #000000;
  text-decoration: none;
  margin: 0 2px;
  will-change: transform, box-shadow;
}

.bottom-nav-item:hover {
  background: var(--surface-container);
  color: #000;
  border-color: #000000;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 0 #000;
}

.bottom-nav-item.active {
  background-color: var(--primary-container);
  color: #000;
  border: 2px solid #000000;
  transform: translate(2px, 2px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.bottom-nav-item.active:hover {
  background-color: var(--primary-container);
  color: #000;
  border-color: #000;
  transform: translate(-2px, -2px);
  box-shadow: inset 3px 3px 0 0 #000, 5px 5px 0 0 #000;
}

.bottom-nav-item:not(.active):active,
.bottom-nav-item.active:active {
  background-color: var(--surface-container);
  color: #000;
  border-color: #000;
  transform: translate(4px, 4px);
  box-shadow: inset 4px 4px 0 0 #000;
}

.bottom-nav-item .material-symbols-outlined {
  font-size: 32px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 32;
}

.bottom-nav-item .label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  margin-top: 0;
  letter-spacing: 0;
}

/* ==========================================================================
   Shared UI: Window and Windowed Page Template
   ========================================================================== */

/* ----- Windowed Page Template ----- */
.window {
  position: absolute;
  top: 80px;
  left: calc(50% - 280px);
  width: 560px;
  height: auto;
  min-width: 360px;
  min-height: 280px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: #fff;
  border: 3px solid #000;
  box-shadow: 8px 8px 0 0 var(--window-shadow);
  display: flex;
  flex-direction: column;
  z-index: 50;
  font-family: 'Space Grotesk', sans-serif;
  transform: translate(0, 0);
  transition: filter 0.12s linear, transform 0.12s linear, box-shadow 0.12s linear, background-color 0.12s linear;
  will-change: filter, transform, box-shadow;
}

.windowed-page {
  background: #fff;
  border: 3px solid #000;
}

.windowed-page:has(> .window-page-nav) {
  overflow: visible;
}

.window.is-active {
  box-shadow: 13px 13px 0 0 var(--window-shadow);
  filter: none;
  transform: translate(-3px, -3px);
  z-index: 90;
}

.window.is-inactive {
  box-shadow: 4px 4px 0 0 var(--window-shadow-soft);
  filter: brightness(1.12) saturate(0.78);
  transform: translate(2px, 2px);
  z-index: 45;
}

.window.focus-active {
  max-height: calc(100% - 32px);
  z-index: 1100 !important;
}

.window.dragging {
  opacity: 0.92;
  user-select: none;
}

.window.resizing {
  user-select: none;
}

.window-resize-handle {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 32px;
  height: 32px;
  background:
    linear-gradient(135deg, transparent 0 42%, #000 42% 48%, transparent 48% 56%, #000 56% 62%, transparent 62% 70%, #000 70% 76%, transparent 76% 84%, #000 84% 90%, transparent 90%);
  cursor: var(--cursor-resize-nwse);
  z-index: 5;
}

.window[data-state="hidden"] {
  display: none;
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000;
  color: #fff;
  border-bottom: 3px solid #000;
  padding: 6px 8px;
  cursor: var(--cursor-move);
  user-select: none;
}

.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.window-title .material-symbols-outlined {
  font-size: 18px;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  cursor: var(--cursor-pointer);
  padding: 0;
  transition: background-color 0.08s linear, color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.window-btn .material-symbols-outlined {
  font-size: 18px;
}

.window-btn[aria-pressed="true"] {
  background: #ffe600;
  color: #000;
  box-shadow: inset 2px 2px 0 0 #b89600;
}

.window-btn[aria-pressed="true"]:active {
  background: #ffd000;
  color: #000;
}

.window-btn-close {
  background: #fff;
  color: #d50000;
  box-shadow: 3px 3px 0 0 #b00000;
}

.window-btn-close:hover {
  background: #ffe9e3;
  color: #d50000;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #b00000;
}

.window-btn-close:active {
  background: #b00000;
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #b00000;
}

/* Colored shadows for window controls to match neo-brutalist theme */
.window-btn[data-action="window-maximize"] {
  box-shadow: 3px 3px 0 0 #006493;
}

.window-btn[data-action="window-maximize"]:hover {
  background: #cae6ff;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #006493;
}

.window-btn[data-action="window-maximize"]:active {
  background: #006493;
  color: #fff;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #006493;
}

.window-btn[data-action="window-preview"] {
  box-shadow: 3px 3px 0 0 #ffdc4a;
}

.window-btn[data-action="window-preview"]:hover {
  background: #fff176;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 #ffdc4a;
}

.window-btn[data-action="window-preview"]:active {
  background: #ffd000;
  color: #000;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #ffdc4a;
}

.window-btn[data-action="window-preview"][aria-pressed="true"] {
  background: #ffe600;
  color: #000;
  box-shadow: inset 2px 2px 0 0 #ffdc4a;
}

.window-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #fff;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.windowed-page .window-body {
  padding-bottom: 72px;
}

.window-page-nav {
  position: absolute;
  left: 8px;
  bottom: -30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.72);
  overflow: visible;
  z-index: 12;
}

.window-page-nav-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-width-sm) solid #000;
  background: #fff;
  color: #000;
  cursor: var(--cursor-pointer);
  box-shadow: 4px 4px 0 0 rgba(0, 0, 0, 1);
  padding: 0;
  transition: background-color 0.1s, transform 0.1s, box-shadow 0.1s;
}

.window-page-nav-btn:hover {
  background: var(--surface-variant);
}

.window-page-nav-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 rgba(0, 0, 0, 1);
}

.window-page-nav-btn .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   Widgets: Calculator
   ========================================================================== */

.calculator-window {
  top: 96px;
  left: calc(50% - 150px);
  width: 300px;
  min-width: 300px;
  min-height: 0;
  max-width: 300px;
  background: #b7c7d8;
  border-width: 4px;
  box-shadow: 10px 10px 0 0 #000, inset 4px 4px 0 0 rgba(255, 255, 255, 0.62), inset -5px -5px 0 0 rgba(27, 47, 68, 0.28);
}

.calculator-window.is-active {
  box-shadow: 16px 16px 0 0 #000, inset 5px 5px 0 0 rgba(255, 255, 255, 0.68), inset -6px -6px 0 0 rgba(27, 47, 68, 0.32);
  filter: none;
  transform: translate(-4px, -4px);
  z-index: 90;
}

.calculator-window.is-inactive {
  background: #d9e4ed;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.62), inset 4px 4px 0 0 rgba(255, 255, 255, 0.76), inset -4px -4px 0 0 rgba(27, 47, 68, 0.12);
  filter: brightness(1.08) saturate(0.72);
  transform: translate(2px, 2px);
  z-index: 45;
}

.calculator-window[data-mode="scientific"] {
  left: calc(50% - 288px);
  width: 576px;
  min-width: 576px;
  max-width: 576px;
}

.calculator-window[data-state="hidden"] {
  display: none;
}

.calculator-window .window-titlebar {
  background: #7fa6c9;
  box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, 0.18);
}

.calculator-window.is-inactive .window-titlebar {
  background: #b8cede;
}

.calculator-shell {
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 38%),
    #b7c7d8;
  border-top: 3px solid #000;
  box-shadow: inset 5px 5px 0 0 rgba(255, 255, 255, 0.5), inset -6px -6px 0 0 rgba(27, 47, 68, 0.22);
}

.calculator-display {
  min-height: 86px;
  margin-bottom: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #c8d8a8;
  border: 4px solid #000;
  box-shadow: inset 5px 5px 0 0 #6f8052, inset -2px -2px 0 0 rgba(255, 255, 255, 0.62);
  color: #1f2d16;
}

.calculator-expression {
  min-height: 17px;
  display: block;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
  text-align: right;
  opacity: 0.72;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calculator-memory {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.calculator-output {
  width: 100%;
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  text-align: right;
  letter-spacing: -0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calculator-keypad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.calculator-window[data-mode="scientific"] .calculator-keypad {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.calculator-window[data-mode="basic"] .calculator-key-scientific {
  display: none;
}

.calculator-window[data-mode="basic"] .calculator-key-clear {
  order: 1;
}

.calculator-window[data-mode="basic"] .calculator-key-operator[data-value="/"] {
  order: 2;
}

.calculator-window[data-mode="basic"] .calculator-key-operator[data-value="*"] {
  order: 3;
}

.calculator-window[data-mode="basic"] .calculator-key-operator[data-value="-"] {
  order: 4;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="7"] {
  order: 5;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="8"] {
  order: 6;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="9"] {
  order: 7;
}

.calculator-window[data-mode="basic"] .calculator-key-operator[data-value="+"] {
  order: 8;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="4"] {
  order: 9;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="5"] {
  order: 10;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="6"] {
  order: 11;
}

.calculator-window[data-mode="basic"] .calculator-key-equals {
  order: 12;
  grid-row: span 2;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="1"] {
  order: 13;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="2"] {
  order: 14;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="3"] {
  order: 15;
}

.calculator-window[data-mode="basic"] .calculator-key-zero {
  order: 16;
}

.calculator-window[data-mode="basic"] .calculator-key[data-value="."] {
  order: 17;
}

.calculator-key {
  min-height: 44px;
  padding: 0;
  border: 3px solid #000;
  background: #eef3f7;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
  box-shadow: 5px 5px 0 0 #33485a, inset 3px 3px 0 0 rgba(255, 255, 255, 0.9), inset -4px -4px 0 0 rgba(39, 61, 80, 0.18);
  transform: translate(-2px, -2px);
  transition: background-color 0.08s linear, color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.calculator-key:hover {
  background: #f8fbff;
  transform: translate(-4px, -4px);
  box-shadow: 7px 7px 0 0 #33485a, inset 3px 3px 0 0 rgba(255, 255, 255, 0.94), inset -4px -4px 0 0 rgba(39, 61, 80, 0.18);
}

.calculator-key:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #33485a, inset 4px 4px 0 0 #000;
}

.calculator-key.is-pressed,
.calculator-key.is-pressed:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #33485a, inset 4px 4px 0 0 #000;
}

.calculator-key-scientific {
  background: #d7e1ea;
  font-size: 14px;
  box-shadow: 5px 5px 0 0 #526879, inset 3px 3px 0 0 rgba(255, 255, 255, 0.86), inset -4px -4px 0 0 rgba(39, 61, 80, 0.18);
}

.calculator-key-scientific:hover {
  background: #e8f0f7;
  box-shadow: 7px 7px 0 0 #526879, inset 3px 3px 0 0 rgba(255, 255, 255, 0.9), inset -4px -4px 0 0 rgba(39, 61, 80, 0.18);
}

.calculator-key-scientific.is-pressed,
.calculator-key-scientific.is-pressed:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #526879, inset 4px 4px 0 0 #000;
}

.calculator-key-operator {
  background: #9fc4e2;
  box-shadow: 5px 5px 0 0 #006493, inset 3px 3px 0 0 rgba(255, 255, 255, 0.76), inset -4px -4px 0 0 rgba(0, 100, 147, 0.22);
}

.calculator-key-operator:hover {
  background: #bdd9ef;
  box-shadow: 7px 7px 0 0 #006493, inset 3px 3px 0 0 rgba(255, 255, 255, 0.8), inset -4px -4px 0 0 rgba(0, 100, 147, 0.22);
}

.calculator-key-operator.is-pressed,
.calculator-key-operator.is-pressed:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #006493, inset 4px 4px 0 0 #000;
}

.calculator-key-clear {
  background: #ffe9e3;
  color: #d50000;
  box-shadow: 5px 5px 0 0 #b00000, inset 3px 3px 0 0 rgba(255, 255, 255, 0.76), inset -4px -4px 0 0 rgba(171, 54, 0, 0.22);
}

.calculator-key-clear:hover {
  background: #fff1ec;
  box-shadow: 7px 7px 0 0 #b00000, inset 3px 3px 0 0 rgba(255, 255, 255, 0.8), inset -4px -4px 0 0 rgba(171, 54, 0, 0.22);
}

.calculator-key-clear.is-pressed,
.calculator-key-clear.is-pressed:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #b00000, inset 4px 4px 0 0 #000;
}

.calculator-key-equals {
  background: #5f7f9b;
  color: #fff;
  box-shadow: 5px 5px 0 0 #24384b, inset 3px 3px 0 0 rgba(255, 255, 255, 0.35), inset -4px -4px 0 0 rgba(0, 0, 0, 0.24);
}

.calculator-key-equals:hover {
  background: #7697b4;
  box-shadow: 7px 7px 0 0 #24384b, inset 3px 3px 0 0 rgba(255, 255, 255, 0.4), inset -4px -4px 0 0 rgba(0, 0, 0, 0.24);
}

.calculator-key-equals.is-pressed,
.calculator-key-equals.is-pressed:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 0 #24384b, inset 4px 4px 0 0 #000;
}

.calculator-key-zero {
  grid-column: span 2;
}

.calculator-window[data-mode="scientific"] .calculator-key-zero {
  grid-column: span 1;
}

.calculator-context-menu {
  position: fixed;
  z-index: 2400;
  min-width: 260px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 6px;
  background: #d9e8f2;
  border: 3px solid #000;
  box-shadow: 7px 7px 0 0 #33485a;
}

.calculator-context-menu[data-state="visible"] {
  display: flex;
}

.calculator-context-item {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 1.2em;
  background: #eef3f7;
  border: 2px solid transparent;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
}

.calculator-context-item:hover,
.calculator-context-item:focus-visible {
  background: #f8fbff;
  border-color: #000;
  outline: none;
}

.calculator-context-item:active {
  box-shadow: inset 2px 2px 0 0 #000;
}

.calculator-context-item .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 0, 'wght' 700, 'GRAD' 0, 'opsz' 20;
}

.calculator-context-close {
  margin-top: 4px;
  background: #ffe9e3;
  color: #d50000;
  border-color: #000;
}

.calculator-context-close:hover,
.calculator-context-close:focus-visible {
  background: #fff1ec;
  color: #b00000;
}

/* ==========================================================================
   Widgets: Pomodoro
   ========================================================================== */

.pomodoro-window {
  top: 86px;
  left: calc(50% - 210px);
  width: 420px;
  min-width: 420px;
  min-height: 0;
  max-width: 420px;
  background: #d62519;
  border-width: 4px;
  box-shadow: 10px 10px 0 0 #000, inset 5px 5px 0 0 rgba(255, 255, 255, 0.32), inset -8px -8px 0 0 rgba(91, 14, 8, 0.35);
}

.pomodoro-window.is-active {
  background: #d62519;
  box-shadow: 16px 16px 0 0 #000, inset 6px 6px 0 0 rgba(255, 255, 255, 0.38), inset -9px -9px 0 0 rgba(91, 14, 8, 0.38);
  transform: translate(-4px, -4px);
  z-index: 90;
}

.pomodoro-window.is-inactive {
  background: #f06b5e;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.58), inset 4px 4px 0 0 rgba(255, 255, 255, 0.52), inset -5px -5px 0 0 rgba(91, 14, 8, 0.14);
  transform: translate(2px, 2px);
  z-index: 45;
}

.pomodoro-window .window-titlebar {
  background: #207531;
  box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, 0.22);
  transition: background-color 0.12s linear, box-shadow 0.12s linear;
}

.pomodoro-window.is-active .window-titlebar {
  background: #207531;
}

.pomodoro-window.is-inactive .window-titlebar {
  background: #74be82;
  box-shadow: inset 0 -2px 0 0 rgba(0, 0, 0, 0.14);
}

.pomodoro-shell {
  position: relative;
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.45), transparent 18%),
    linear-gradient(145deg, #ff4a35 0%, #df261a 46%, #a80f0a 100%);
  border-top: 4px solid #000;
  box-shadow: inset 6px 6px 0 0 rgba(255, 255, 255, 0.28), inset -7px -7px 0 0 rgba(91, 14, 8, 0.28);
  overflow: hidden;
  transition: box-shadow 0.12s linear, filter 0.12s linear;
}

.pomodoro-window.is-active .pomodoro-shell {
  box-shadow: inset 7px 7px 0 0 rgba(255, 255, 255, 0.34), inset -8px -8px 0 0 rgba(91, 14, 8, 0.34);
}

.pomodoro-window.is-inactive .pomodoro-shell {
  filter: brightness(1.16) saturate(0.76);
  box-shadow: inset 5px 5px 0 0 rgba(255, 255, 255, 0.46), inset -5px -5px 0 0 rgba(91, 14, 8, 0.12);
}

.pomodoro-leaf {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 116px;
  height: 56px;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.pomodoro-leaf span {
  position: absolute;
  left: 38px;
  top: 6px;
  width: 44px;
  height: 30px;
  background: #25a244;
  border: 3px solid #000;
  border-radius: 100% 0 100% 0;
  box-shadow: 4px 4px 0 0 #0d5f24, inset 4px 4px 0 0 rgba(255, 255, 255, 0.28);
  transform-origin: 50% 100%;
  transition: background-color 0.12s linear, box-shadow 0.12s linear;
}

.pomodoro-window.is-active .pomodoro-leaf span {
  box-shadow: 6px 6px 0 0 #0d5f24, inset 4px 4px 0 0 rgba(255, 255, 255, 0.34);
}

.pomodoro-window.is-inactive .pomodoro-leaf span {
  background: #74be82;
  box-shadow: 2px 2px 0 0 rgba(13, 95, 36, 0.55), inset 4px 4px 0 0 rgba(255, 255, 255, 0.42);
}

.pomodoro-leaf span:first-child {
  transform: translateX(-28px) rotate(-34deg);
}

.pomodoro-leaf span:nth-child(2) {
  top: 0;
  transform: rotate(-8deg);
}

.pomodoro-leaf span:last-child {
  transform: translateX(28px) rotate(34deg);
}

.pomodoro-tomato {
  --pomodoro-progress: 0;
  position: relative;
  width: 250px;
  height: 250px;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.62), transparent 12%),
    conic-gradient(from -90deg, #83110c calc(var(--pomodoro-progress) * 1%), transparent 0),
    radial-gradient(circle at 34% 30%, #ff654f 0 24%, #e52519 58%, #a70d08 100%);
  border: 5px solid #000;
  border-radius: 48% 52% 50% 50% / 44% 46% 54% 56%;
  box-shadow: 12px 12px 0 0 #000, inset 12px 12px 0 0 rgba(255, 255, 255, 0.2), inset -16px -16px 0 0 rgba(78, 7, 3, 0.3);
  color: #fff9f4;
  transition: box-shadow 0.12s linear, filter 0.12s linear, transform 0.12s linear;
}

.pomodoro-window.is-active .pomodoro-tomato {
  box-shadow: 17px 17px 0 0 #000, inset 14px 14px 0 0 rgba(255, 255, 255, 0.24), inset -18px -18px 0 0 rgba(78, 7, 3, 0.34);
  transform: translate(-2px, -2px);
}

.pomodoro-window.is-inactive .pomodoro-tomato {
  filter: brightness(1.15) saturate(0.78);
  box-shadow: 6px 6px 0 0 rgba(0, 0, 0, 0.62), inset 10px 10px 0 0 rgba(255, 255, 255, 0.32), inset -10px -10px 0 0 rgba(78, 7, 3, 0.12);
  transform: translate(1px, 1px);
}

.pomodoro-tomato::before,
.pomodoro-tomato::after {
  content: "";
  position: absolute;
  bottom: 34px;
  width: 38px;
  height: 58px;
  background: rgba(111, 7, 4, 0.18);
  border-radius: 50%;
}

.pomodoro-tomato::before {
  left: 18px;
  transform: rotate(16deg);
}

.pomodoro-tomato::after {
  right: 18px;
  transform: rotate(-16deg);
}

.pomodoro-highlight {
  position: absolute;
  top: 42px;
  left: 58px;
  width: 46px;
  height: 28px;
  background: rgba(255, 255, 255, 0.66);
  border: 3px solid #000;
  border-radius: 50%;
  transform: rotate(-24deg);
  box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.28);
}

.pomodoro-face {
  position: absolute;
  top: 82px;
  left: 50%;
  display: flex;
  gap: 70px;
  transform: translateX(-50%);
}

.pomodoro-face span {
  width: 18px;
  height: 22px;
  background: #000;
  border-radius: 50%;
  box-shadow: inset 4px 4px 0 0 rgba(255, 255, 255, 0.28);
}

.pomodoro-time {
  position: relative;
  z-index: 2;
  margin-top: 34px;
  font-size: 58px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.08em;
  text-shadow: 4px 4px 0 #000;
}

.pomodoro-session-label {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  padding: 5px 10px;
  background: #fff3dd;
  border: 3px solid #000;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 0 #000;
}

.pomodoro-mode-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.pomodoro-mode,
.pomodoro-control {
  border: 3px solid #000;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  transition: background-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.pomodoro-mode {
  min-height: 42px;
  padding: 6px 8px;
  background: #fff3dd;
  color: #000;
  font-size: 11px;
  box-shadow: 4px 4px 0 0 #000;
}

.pomodoro-mode:hover,
.pomodoro-control:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 #000;
}

.pomodoro-mode.active {
  background: #25a244;
  box-shadow: inset 3px 3px 0 0 #000;
  transform: translate(2px, 2px);
}

.pomodoro-controls {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pomodoro-control {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff3dd;
  color: #000;
  font-size: 14px;
  box-shadow: 5px 5px 0 0 #000;
}

.pomodoro-control:active,
.pomodoro-mode:active {
  transform: translate(3px, 3px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.pomodoro-start {
  background: #25a244;
}

.pomodoro-start.is-running {
  background: #ffd166;
}

.pomodoro-control .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0, 'wght' 900, 'GRAD' 0, 'opsz' 24;
}

.pomodoro-status {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #000;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pomodoro-progress-track {
  height: 22px;
  background: #fff3dd;
  border: 3px solid #000;
  box-shadow: inset 4px 4px 0 0 rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.pomodoro-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #25a244 0 12px, #207531 12px 20px);
  border-right: 3px solid #000;
  transition: width 0.18s linear;
}

/* ==========================================================================
   Widgets: TradingView
   ========================================================================== */

.stock-window {
  top: 74px;
  left: calc(50% - 360px);
  width: 720px;
  min-width: 640px;
  min-height: 0;
  max-width: calc(100% - 32px);
  background: #1f2d16;
  border-width: 4px;
  box-shadow: 10px 10px 0 0 #000, inset 5px 5px 0 0 rgba(216, 247, 197, 0.24), inset -7px -7px 0 0 rgba(0, 0, 0, 0.28);
}

.stock-window.is-active {
  box-shadow: 16px 16px 0 0 #000, inset 6px 6px 0 0 rgba(216, 247, 197, 0.28), inset -8px -8px 0 0 rgba(0, 0, 0, 0.32);
  transform: translate(-4px, -4px);
  z-index: 90;
}

.stock-window.is-inactive {
  background: #53634a;
  box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.62), inset 4px 4px 0 0 rgba(255, 255, 255, 0.26), inset -4px -4px 0 0 rgba(0, 0, 0, 0.12);
  filter: brightness(1.08) saturate(0.72);
  transform: translate(2px, 2px);
  z-index: 45;
}

.stock-window .window-titlebar {
  background: #8ad957;
  color: #071b0d;
}

.stock-shell {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(216, 247, 197, 0.18), transparent 42%),
    #1f2d16;
  border-top: 4px solid #000;
  color: #f5ffe9;
}

.stock-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.stock-symbol-control,
.stock-strategy-chip,
.stock-timeframe-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #d8f7c5;
  border: 3px solid #000;
  color: #071b0d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 0 #000;
}

.stock-symbol-control {
  flex: 1 1 auto;
}

.stock-symbol-select {
  flex: 1 1 auto;
  min-width: 96px;
  padding: 6px 8px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 900;
  cursor: var(--cursor-pointer);
}

.stock-strategy-chip {
  background: #cae6ff;
}

.stock-timeframe-chip {
  background: #fff1a8;
}

.stock-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stock-stat {
  min-height: 74px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #fff;
  border: 3px solid #000;
  color: #000;
  box-shadow: 4px 4px 0 0 #000;
}

.stock-stat span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-stat strong {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.stock-stat-positive strong {
  color: #197a2e;
}

.stock-stat-negative strong {
  color: #b00000;
}

.stock-chart-panel {
  padding: 12px;
  background: #10170d;
  border: 4px solid #000;
  box-shadow: inset 5px 5px 0 0 rgba(216, 247, 197, 0.1), inset -5px -5px 0 0 rgba(0, 0, 0, 0.36);
}

.stock-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #d8f7c5;
}

.stock-chart-label {
  display: block;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.78;
}

.stock-chart-symbol {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.stock-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.stock-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stock-legend i {
  width: 12px;
  height: 12px;
  border: 2px solid #000;
}

.stock-legend-up {
  background: #8ad957;
}

.stock-legend-down {
  background: #ff8a8a;
}

.stock-legend-equity {
  background: #8dcdff;
}

.stock-chart {
  width: 100%;
  height: 300px;
  display: block;
  background:
    linear-gradient(#2a3823 1px, transparent 1px),
    linear-gradient(90deg, #2a3823 1px, transparent 1px),
    #10170d;
  background-size: 100% 48px, 72px 100%, 100% 100%;
  border: 3px solid #000;
}

.stock-chart-grid {
  stroke: rgba(216, 247, 197, 0.18);
  stroke-width: 1;
}

.stock-candle-up {
  fill: #8ad957;
  stroke: #000;
  stroke-width: 2;
}

.stock-candle-down {
  fill: #ff8a8a;
  stroke: #000;
  stroke-width: 2;
}

.stock-wick {
  stroke: #f5ffe9;
  stroke-width: 2;
}

.stock-equity-line {
  fill: none;
  stroke: #8dcdff;
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.stock-signal-buy {
  fill: #8ad957;
  stroke: #000;
  stroke-width: 3;
}

.stock-signal-sell {
  fill: #ff8a8a;
  stroke: #000;
  stroke-width: 3;
}

.stock-backtest-log {
  background: #fff;
  border: 3px solid #000;
  color: #000;
  box-shadow: 4px 4px 0 0 #000;
}

.stock-log-row {
  display: grid;
  grid-template-columns: 1fr 0.7fr 0.8fr 0.8fr;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 2px solid #000;
  font-size: 12px;
  font-weight: 800;
}

.stock-log-row:last-child {
  border-bottom: none;
}

.stock-log-head {
  background: #d8f7c5;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stock-profit {
  color: #197a2e;
}

.stock-loss {
  color: #b00000;
}

/* ==========================================================================
   Widgets: Backtester
   ========================================================================== */

/* ---- Backtester widget ---- */
.backtester-window {
  top: calc(var(--top-bar-height, 48px) + 8px);
  left: 22.5vw;
  width: 55vw;
  min-width: 720px;
  height: calc((100vh - var(--top-bar-height, 48px) - 80px) * 0.85);
  min-height: 520px;
  max-width: calc(100% - 32px);
  background: #eef4c8;
  border-width: 4px;
  color: #182006;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
}

.backtester-window .window-titlebar {
  background: #d7ff4f;
  color: #182006;
  border-bottom: 4px solid #000;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
}

.backtester-window .window-btn[data-action="bt-focus"] {
  box-shadow: 3px 3px 0 0 #ffdc4a;
}

.backtester-window .window-btn[data-action="bt-focus"]:hover {
  box-shadow: 4px 4px 0 0 #ffdc4a;
}

.backtester-window .window-btn[data-action="bt-focus"]:active {
  box-shadow: 1px 1px 0 0 #ffdc4a;
}

.backtester-window .window-btn[data-action="bt-focus"][aria-pressed="true"] {
  box-shadow: inset 2px 2px 0 0 #ffdc4a;
}

.bt-shell {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  height: calc(100% - 48px);
  overflow: hidden;
  background: #f4f7d8;
  border-top: 4px solid #000;
}

.bt-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bt-control-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(360px, 1.35fr);
  align-items: stretch;
  gap: 12px;
}

.bt-control-card {
  background: #f9fbe7;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 0 #000;
}

.bt-ticker-card {
  display: flex;
  align-items: stretch;
  padding: 10px;
}

.bt-control-grid > .bt-control-card {
  min-height: 103px;
}

.bt-date-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
}

.bt-date-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bt-action-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 8px 0;
  overflow: visible;
}

.bt-strategy-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  margin-bottom: 7px;
}

.bt-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #3d4a0a;
}

.bt-field span {
  padding-left: 2px;
}

.bt-field-ticker {
  position: relative;
  flex: 1;
  justify-content: space-between;
}

.bt-input {
  min-height: 34px;
  padding: 6px 10px;
  border: 3px solid #000;
  background:
    radial-gradient(rgba(24, 32, 6, 0.12) 0.8px, transparent 0.9px) 0 0 / 7px 7px,
    radial-gradient(rgba(24, 32, 6, 0.06) 0.7px, transparent 0.8px) 3px 4px / 9px 9px,
    #fbf7df;
  color: #182006;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.9), inset -2px -2px 0 rgba(109, 132, 24, 0.22), 3px 3px 0 0 #000;
  cursor: var(--cursor-default);
}

.bt-input[type="text"] {
  text-transform: uppercase;
  width: 100%;
  min-width: 118px;
  min-height: 54px;
  flex: 1;
  padding-right: 28px;
  font-size: 32px;
  text-align: center;
}

.bt-edit-cursor {
  position: absolute;
  right: 14px;
  bottom: 13px;
  width: 13px;
  height: 23px;
  padding: 0;
  border-top: 2px solid #a6ada0;
  border-bottom: 2px solid #a6ada0;
  background: linear-gradient(90deg, transparent 0 5px, #a6ada0 5px 8px, transparent 8px 100%);
  opacity: 0.78;
  pointer-events: none;
}

.bt-input[type="date"] {
  width: 100%;
  color-scheme: light;
}

.bt-input[type="date"]::-webkit-calendar-picker-indicator {
  border: 2px solid #000;
  background-color: #d7ff4f;
  cursor: var(--cursor-pointer);
  padding: 2px;
}

.bt-input:focus {
  outline: none;
  background:
    radial-gradient(rgba(24, 32, 6, 0.13) 0.8px, transparent 0.9px) 0 0 / 7px 7px,
    radial-gradient(rgba(24, 32, 6, 0.07) 0.7px, transparent 0.8px) 3px 4px / 9px 9px,
    #fff9df;
  color: #000;
}

.bt-run-btn {
  position: relative;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  margin-left: auto;
  padding: 8px 20px 7px;
  background: #d7ff4f;
  color: #061006;
  border: 3px solid #000;
  border-radius: 5px;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 7px 0 #8fa91f, 4px 11px 0 #000;
  cursor: var(--cursor-pointer);
  transition: top 0.08s ease, box-shadow 0.08s ease, transform 0.08s ease;
  transform: translateZ(0);
}

.bt-run-btn .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
}

.bt-run-btn:hover {
  top: -1px;
  box-shadow: 0 8px 0 #8fa91f, 4px 12px 0 #000;
  transform: translateZ(0);
}

.bt-run-btn:active {
  top: 5px;
  box-shadow: 0 2px 0 #8fa91f, 1px 3px 0 #000;
  transform: translateZ(0);
}

.bt-run-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.bt-chip-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.bt-date-card > .bt-chip-group {
  align-self: flex-end;
  justify-content: flex-end;
  padding: 0 0 1px;
}

.bt-chip-label {
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #5b6619;
  margin-right: 2px;
}

.bt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 3px 9px;
  background: #edf5ba;
  color: #182006;
  border: 2px solid #000;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.82), inset -1px -1px 0 rgba(109, 132, 24, 0.2), 3px 3px 0 0 #000;
  cursor: var(--cursor-pointer);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.bt-chip small {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.7;
}

.bt-chip:hover {
  background: #f8ffd2;
  color: #000;
}

.bt-chip.active,
.bt-chip[aria-pressed="true"] {
  background: #c8e84a;
  color: #061006;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 #000;
}

.bt-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.bt-stat {
  min-height: 58px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #f9fbe7;
  border: 3px solid #000;
  color: #182006;
  box-shadow: 4px 4px 0 0 #000;
}

.bt-stat span {
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #5b6619;
}

.bt-stat strong {
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
}

.bt-stat[data-state="up"] strong { color: #1f7a2f; }
.bt-stat[data-state="down"] strong { color: #ff6b4a; }

.bt-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 292px;
}

.bt-chart-panel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  background: #244f8f;
  border: 4px solid #000;
  color: #f5ffe9;
  box-shadow: 5px 5px 0 0 #000;
}

.bt-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.bt-chart-title {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.bt-chart-label {
  display: inline-block;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

.bt-chart-symbol {
  display: inline-block;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  color: #d7ff4f;
}

.bt-chart-meta {
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.78;
}

.bt-compare-buttons {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: -2px;
}

.bt-chip-compare {
  background: #07100a;
  color: #caffc4;
  min-height: 22px;
  padding: 1px 7px;
  font-size: 13px;
  box-shadow: 2px 2px 0 0 #000;
}

.bt-chart {
  width: 100%;
  flex: 1 1 auto;
  min-height: 212px;
  display: block;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 50%, rgba(112, 255, 124, 0.22), transparent 58%),
    linear-gradient(rgba(92, 255, 119, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 255, 119, 0.18) 1px, transparent 1px),
    #061609;
  background-size: 100% 100%, 100% 100%, 100% 48px, 72px 100%, 100% 100%;
  border: 3px solid #000;
}

.bt-chart-grid { stroke: rgba(116, 255, 135, 0.24); stroke-width: 1; }
.bt-chart-line { fill: none; stroke: #8dcdff; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.bt-chart-line-up { stroke: #62ff72; }
.bt-chart-line-down { stroke: #ff8a8a; }
.bt-chart-area { fill: rgba(98, 255, 114, 0.12); stroke: none; }
.bt-chart-axis { fill: rgba(199, 255, 203, 0.82); font-family: 'Departure Mono', ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 400; }
.bt-chart-marker { stroke: #000; stroke-width: 2; }
.bt-chart-marker-buy { fill: #62ff72; }
.bt-chart-marker-sell { fill: #ff8a8a; }

.bt-status {
  min-height: 24px;
  flex: 0 0 24px;
  padding: 4px 8px;
  background: #f9fbe7;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 #000;
  font-family: 'Departure Mono', ui-monospace, Menlo, monospace;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #5b6619;
}

.bt-status[data-tone="error"] { color: #ff6b4a; }
.bt-status[data-tone="ok"] { color: #1f7a2f; }

body.main-page.night-mode .backtester-window {
  background: #070b0a;
  color: #d8ffd6;
}

body.main-page.night-mode .backtester-window .window-titlebar {
  background: #153b22;
  color: #b8ff9a;
  border-color: #8ad957;
  text-shadow: 0 0 5px rgba(91, 255, 96, 0.28);
}

body.main-page.night-mode .bt-shell {
  background:
    linear-gradient(rgba(92, 255, 119, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 255, 119, 0.06) 1px, transparent 1px),
    radial-gradient(circle at 75% 20%, rgba(156, 255, 147, 0.08), transparent 34%),
    #09110d;
  background-size: 18px 18px, 18px 18px, 100% 100%, 100% 100%;
  border-color: #8ad957;
}

body.main-page.night-mode .bt-control-card,
body.main-page.night-mode .bt-stat,
body.main-page.night-mode .bt-status {
  background: #10170d;
  color: #d8ffd6;
  border-color: #8ad957;
}

body.main-page.night-mode .bt-field,
body.main-page.night-mode .bt-chip-label,
body.main-page.night-mode .bt-stat span,
body.main-page.night-mode .bt-status {
  color: #8fe889;
}

body.main-page.night-mode .bt-input,
body.main-page.night-mode .bt-chip {
  background: #07100a;
  color: #caffc4;
  border-color: #8ad957;
  color-scheme: dark;
}

body.main-page.night-mode .bt-input[type="date"]::-webkit-calendar-picker-indicator {
  background-color: #8ad957;
}

body.main-page.night-mode .bt-chip.active,
body.main-page.night-mode .bt-chip[aria-pressed="true"] {
  background: #5cff77;
  color: #061006;
}

body.main-page.night-mode .bt-chart-panel {
  border-color: #8ad957;
}

body.main-page.night-mode .bt-stat[data-state="up"] strong,
body.main-page.night-mode .bt-status[data-tone="ok"] {
  color: #5cff77;
}

@media (max-width: 1100px) {
  .bt-charts {
    grid-template-columns: 1fr 1fr;
    min-height: 270px;
  }
  .bt-chart {
    min-height: 190px;
  }
  .backtester-window { width: 90vw; left: 5vw; min-width: 0; }
}

.top-nav a:hover,
.top-nav-menu:hover .top-nav-trigger:not(.top-nav-active) {
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav a.top-nav-active:hover {
  box-shadow: inset 2px 2px 0 0 #000, 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav-dropdown {
  box-shadow: 3px 3px 0 0 rgba(58, 58, 58, 0.35);
}

.top-nav-dropdown-item,
.top-nav-menu.menu-open .top-nav-dropdown-item {
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.top-nav-dropdown-item:hover {
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
}

.top-nav-menu.menu-open .top-nav-dropdown-item:hover {
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.window {
  box-shadow: 8px 8px 0 0 var(--window-shadow);
}

.window.is-active {
  box-shadow: 13px 13px 0 0 var(--window-shadow);
}

.window.is-inactive {
  box-shadow: 4px 4px 0 0 var(--window-shadow-soft);
}

.calculator-window {
  box-shadow: 10px 10px 0 0 var(--window-shadow), inset 4px 4px 0 0 rgba(255, 255, 255, 0.62), inset -5px -5px 0 0 rgba(27, 47, 68, 0.28);
}

.calculator-window.is-active {
  box-shadow: 16px 16px 0 0 var(--window-shadow), inset 5px 5px 0 0 rgba(255, 255, 255, 0.68), inset -6px -6px 0 0 rgba(27, 47, 68, 0.32);
}

.calculator-window.is-inactive {
  box-shadow: 5px 5px 0 0 var(--window-shadow-soft), inset 4px 4px 0 0 rgba(255, 255, 255, 0.76), inset -4px -4px 0 0 rgba(27, 47, 68, 0.12);
}

.pomodoro-window {
  box-shadow: 10px 10px 0 0 var(--window-shadow), inset 5px 5px 0 0 rgba(255, 255, 255, 0.32), inset -8px -8px 0 0 rgba(91, 14, 8, 0.35);
}

.pomodoro-window.is-active {
  box-shadow: 16px 16px 0 0 var(--window-shadow), inset 6px 6px 0 0 rgba(255, 255, 255, 0.38), inset -9px -9px 0 0 rgba(91, 14, 8, 0.38);
}

.pomodoro-window.is-inactive {
  box-shadow: 5px 5px 0 0 var(--window-shadow-soft), inset 4px 4px 0 0 rgba(255, 255, 255, 0.52), inset -5px -5px 0 0 rgba(91, 14, 8, 0.14);
}

.pomodoro-tomato {
  box-shadow: 12px 12px 0 0 var(--brutal-shadow), inset 12px 12px 0 0 rgba(255, 255, 255, 0.2), inset -16px -16px 0 0 rgba(78, 7, 3, 0.3);
}

.pomodoro-window.is-active .pomodoro-tomato {
  box-shadow: 17px 17px 0 0 var(--brutal-shadow), inset 14px 14px 0 0 rgba(255, 255, 255, 0.24), inset -18px -18px 0 0 rgba(78, 7, 3, 0.34);
}

.pomodoro-window.is-inactive .pomodoro-tomato {
  box-shadow: 6px 6px 0 0 var(--brutal-shadow-soft), inset 10px 10px 0 0 rgba(255, 255, 255, 0.32), inset -10px -10px 0 0 rgba(78, 7, 3, 0.12);
}

.stock-window {
  box-shadow: 10px 10px 0 0 var(--window-shadow), inset 5px 5px 0 0 rgba(216, 247, 197, 0.24), inset -7px -7px 0 0 rgba(0, 0, 0, 0.28);
}

.stock-window.is-active {
  box-shadow: 16px 16px 0 0 var(--window-shadow), inset 6px 6px 0 0 rgba(216, 247, 197, 0.28), inset -8px -8px 0 0 rgba(0, 0, 0, 0.32);
}

.stock-window.is-inactive {
  box-shadow: 5px 5px 0 0 var(--window-shadow-soft), inset 4px 4px 0 0 rgba(255, 255, 255, 0.26), inset -4px -4px 0 0 rgba(0, 0, 0, 0.12);
}

.stock-symbol-control,
.stock-strategy-chip,
.stock-timeframe-chip,
.stock-stat,
.stock-backtest-log {
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.profile-widget {
  top: 86px;
  right: 34px;
  left: auto;
  width: 420px;
  min-width: 340px;
  min-height: 0;
  background: #fff8f6;
  box-shadow: 10px 10px 0 0 var(--window-shadow), inset 5px 5px 0 0 rgba(255, 255, 255, 0.5), inset -7px -7px 0 0 rgba(171, 54, 0, 0.16);
}

.profile-widget[data-state="hidden"] {
  display: none;
}

.profile-widget.is-active {
  box-shadow: 16px 16px 0 0 var(--window-shadow), inset 6px 6px 0 0 rgba(255, 255, 255, 0.58), inset -8px -8px 0 0 rgba(171, 54, 0, 0.2);
}

.profile-widget.is-inactive {
  box-shadow: 5px 5px 0 0 var(--window-shadow-soft), inset 4px 4px 0 0 rgba(255, 255, 255, 0.68), inset -4px -4px 0 0 rgba(171, 54, 0, 0.08);
}

.profile-widget .window-titlebar {
  background: var(--primary-container);
  color: #fff;
}

.profile-shell {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-identity {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 0 #000;
}

.profile-badge {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tertiary-container);
  color: #001e30;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 0 #000;
  font-size: 26px;
  font-weight: 900;
}

.profile-heading {
  min-width: 0;
}

.profile-heading span,
.profile-stat span,
.profile-detail-row span {
  color: var(--on-surface-variant);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.profile-heading small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  padding: 10px;
  background: var(--surface-container-lowest);
  border: 2px solid #000;
  box-shadow: 4px 4px 0 0 #000;
}

.profile-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-detail-list {
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 0 #000;
}

.profile-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  background: #fff;
}

.profile-detail-row + .profile-detail-row {
  border-top: 2px solid #000;
}

.profile-detail-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}


/* ==========================================================================
   Windowed Pages: Upload
   ========================================================================== */

.upload-window {
  top: 88px;
  left: calc(50% - 330px);
  width: 660px;
  min-width: 560px;
}

.upload-shell {
  position: relative;
}

.upload-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.upload-file-input {
  display: none;
}

.upload-popup {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(39, 24, 19, 0.58);
  z-index: 5;
}

.upload-popup[data-state="visible"] {
  display: flex;
}

.upload-popup-panel {
  width: min(100%, 500px);
  max-height: 100%;
  overflow-y: auto;
  background: #fff;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 0 var(--brutal-shadow);
}

.upload-step {
  display: none;
  padding: 18px;
}

.upload-step.active {
  display: block;
}

.upload-popup-heading h3 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.upload-popup-heading p {
  margin: 0 0 16px;
  color: #5b4138;
  font-size: 13px;
  font-weight: 700;
}

.upload-document-list,
.upload-compact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
}

.upload-document-tile {
  display: grid;
  grid-template-columns: 32px 1fr 28px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fff8d7;
  border: 3px solid #000;
}

.upload-document-tile .material-symbols-outlined {
  color: #ff5f1f;
}

.upload-document-details {
  min-width: 0;
}

.upload-document-name,
.upload-document-size {
  display: block;
}

.upload-document-name {
  overflow: hidden;
  color: #000;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-document-size {
  color: #5b4138;
  font-size: 11px;
  font-weight: 800;
}

.upload-remove-doc {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffe9e3;
  border: 2px solid #000;
  color: #b00000;
  cursor: var(--cursor-pointer);
}

.upload-settings-summary,
.upload-options-group,
.upload-choice-group,
.upload-input-container,
.upload-progress {
  margin-bottom: 14px;
}

.upload-settings-summary {
  padding: 12px;
  background: #fff8d7;
  border: 3px solid #000;
}

.upload-summary-footer {
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  border-top: 3px solid #000;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.upload-doc-count {
  color: #ff5f1f;
}

.upload-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-option-toggle {
  position: relative;
  min-height: 42px;
  padding: 8px 10px 8px 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  overflow: hidden;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: var(--cursor-pointer);
  transition: background-color 0.08s linear, color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.upload-option-toggle:hover {
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.upload-option-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34px;
  background:
    linear-gradient(145deg, #f5f5f0 0%, #e8e8e0 50%, #dcdcd4 100%);
  box-shadow:
    inset 2px 2px 0 0 rgba(255, 255, 255, 0.8),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.06);
  z-index: 2;
}

.upload-option-toggle::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: 34px;
  z-index: 0;
  background: #fff;
  pointer-events: none;
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear;
}

.upload-option-toggle:hover::after {
  transform: translate(-1px, -1px);
}

.upload-option-toggle:hover > span {
  transform: translate(-1px, -1px);
}

.upload-option-toggle > span {
  position: relative;
  z-index: 2;
  transition: transform 0.08s linear;
}

.upload-option-toggle.active,
.upload-option-toggle[aria-pressed="true"] {
  background: #ff5f1f;
  color: #fff;
  transform: translate(0, 0);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.upload-option-toggle.active::after,
.upload-option-toggle[aria-pressed="true"]::after {
  background:
    linear-gradient(145deg, #c8430b 0%, #ff5f1f 48%, #ff8a3d 100%);
  transform: translate(1px, 1px);
  box-shadow:
    inset 5px 5px 0 0 #7a2400,
    inset -3px -3px 0 0 #ffb59c,
    inset 0 0 0 3px rgba(171, 54, 0, 0.32);
}

.upload-option-toggle.active::before,
.upload-option-toggle[aria-pressed="true"]::before {
  background:
    linear-gradient(135deg, transparent 0 18%, rgba(255, 255, 255, 0.88) 18% 25%, transparent 25% 42%, rgba(255, 255, 255, 0.58) 42% 48%, transparent 48% 100%),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.96) 0 10%, transparent 11%),
    radial-gradient(circle at 68% 76%, rgba(32, 117, 49, 0.36) 0 30%, transparent 31%),
    linear-gradient(145deg, #207531 0%, #8ad957 54%, #d8f7c5 100%);
  box-shadow:
    inset 3px 3px 0 0 rgba(216, 247, 197, 0.72),
    inset -3px -3px 0 0 rgba(32, 117, 49, 0.42),
    0 0 8px 0 rgba(138, 217, 87, 0.72);
}

.upload-option-toggle.active > span,
.upload-option-toggle[aria-pressed="true"] > span {
  transform: translate(1px, 1px);
}

.upload-option-toggle.active:hover::after,
.upload-option-toggle[aria-pressed="true"]:hover::after,
.upload-option-toggle.active:hover > span,
.upload-option-toggle[aria-pressed="true"]:hover > span {
  transform: translate(1px, 1px);
}

.upload-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.upload-choice-btn,
.upload-btn,
.upload-icon-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  border: 3px solid #000;
  cursor: var(--cursor-pointer);
}

.upload-choice-btn {
  height: 42px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff8d7;
  color: #000;
  font-size: 11px;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.upload-choice-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.upload-choice-btn.active {
  background: #ff5f1f;
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.upload-input-container select,
.upload-input-container input {
  width: 100%;
  padding: 12px;
  background: #fff8d7;
  border: 3px solid #000;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.upload-progress[data-state="hidden"] {
  display: none;
}

.upload-progress-bar {
  height: 14px;
  background: #fff8d7;
  border: 3px solid #000;
  overflow: hidden;
}

.upload-progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #ff5f1f 0 12px, #ab3600 12px 20px);
  transition: width 0.16s linear;
}

.upload-progress-text {
  display: block;
  margin-top: 6px;
  color: #5b4138;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.upload-popup-actions,
.upload-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-popup-actions {
  justify-content: space-between;
  margin-top: 16px;
}

.upload-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #cae6ff;
  color: #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.upload-icon-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.upload-icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--brutal-shadow);
}

.upload-btn {
  height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.upload-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.upload-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--brutal-shadow);
}

.upload-btn-primary {
  background: #ff5f1f;
  color: #fff;
}

.upload-btn-secondary {
  background: #fff;
  color: #000;
}

.upload-btn-text {
  background: #fff8d7;
  color: #000;
}

.upload-window {
  width: 700px;
  left: calc(50% - 350px);
}

/* ==========================================================================
   Windowed Pages: Create Quiz
   ========================================================================== */

.quiz-window {
  width: 850px;
  left: calc(50% - 425px);
}

.quiz-console-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
}

.quiz-main-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-section {
  background: #fff;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  padding: 12px;
}

.quiz-section-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  margin-bottom: 10px;
}

.quiz-count-display {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: #ff5f1f;
  margin-bottom: 8px;
}

.quiz-count-slider {
  width: 100%;
  height: 8px;
  background: #e8e8e0;
  border: 2px solid #000;
  border-radius: 0;
  cursor: pointer;
  appearance: none;
}

.quiz-count-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: #ff5f1f;
  border: 2px solid #000;
  cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--brutal-shadow);
}

.quiz-count-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #ff5f1f;
  border: 2px solid #000;
  cursor: pointer;
  box-shadow: 2px 2px 0 0 var(--brutal-shadow);
}

.quiz-count-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-types-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.quiz-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.08s linear;
}

.quiz-type-option:hover {
  background: #f5f5f0;
}

.quiz-type-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz-type-option input {
  display: none;
}

.quiz-type-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #000;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-type-option input:checked + .quiz-type-checkbox {
  background: #8ad957;
}

.quiz-type-option input:checked + .quiz-type-checkbox::after {
  content: "✓";
  color: #000;
  font-weight: 900;
  font-size: 12px;
}

.quiz-type-option span:not(.quiz-type-checkbox) {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-type-badge {
  margin-left: auto;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: #000;
  color: #fff;
  padding: 2px 6px;
}

.quiz-documents-list {
  min-height: 80px;
}

.quiz-empty-state {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 24px;
}

.quiz-difficulty-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-difficulty-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 3px solid #000;
  background: #fff;
  cursor: pointer;
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.quiz-difficulty-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.quiz-difficulty-btn.active {
  background: #ff5f1f;
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.quiz-difficulty-btn span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.quiz-difficulty-btn small {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: 2px;
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz-option-toggle {
  position: relative;
  min-height: 42px;
  padding: 8px 10px 8px 38px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  cursor: pointer;
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear;
}

.quiz-option-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.quiz-option-toggle.active {
  background: #ff5f1f;
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.quiz-option-toggle span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-option-toggle small {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.quiz-option-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 28px;
  background:
    linear-gradient(145deg, #f5f5f0 0%, #e8e8e0 50%, #dcdcd4 100%);
  box-shadow:
    inset 2px 2px 0 0 rgba(255, 255, 255, 0.8),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.06);
}

.quiz-option-toggle.active .quiz-option-indicator {
  background:
    linear-gradient(135deg, transparent 0 18%, rgba(255, 255, 255, 0.88) 18% 25%, transparent 25% 42%, rgba(255, 255, 255, 0.58) 42% 48%, transparent 48% 100%),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.96) 0 10%, transparent 11%),
    radial-gradient(circle at 68% 76%, rgba(32, 117, 49, 0.36) 0 30%, transparent 31%),
    linear-gradient(145deg, #207531 0%, #8ad957 54%, #d8f7c5 100%);
  box-shadow:
    inset 3px 3px 0 0 rgba(216, 247, 197, 0.72),
    inset -3px -3px 0 0 rgba(32, 117, 49, 0.42),
    0 0 8px 0 rgba(138, 217, 87, 0.72);
}

.quiz-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.quiz-choice-btn {
  height: 42px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(145deg, #f5f5f0 0%, #e8e8e0 50%, #dcdcd4 100%);
  color: #000;
  font-size: 11px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  border: 3px solid #000;
  box-shadow:
    3px 3px 0 0 var(--brutal-shadow),
    inset 2px 2px 0 0 rgba(255, 255, 255, 0.8),
    inset -2px -2px 0 0 rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.08s linear, box-shadow 0.08s linear, background-color 0.08s linear, color 0.08s linear;
}

.quiz-choice-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.quiz-choice-btn.active {
  background: #ff5f1f;
  color: #fff;
  transform: translate(1px, 1px);
  box-shadow: inset 3px 3px 0 0 #000;
}

.quiz-input-container {
  margin-bottom: 8px;
}

.quiz-select,
.quiz-input {
  width: 100%;
  padding: 10px 12px;
  background: #fff8d7;
  border: 3px solid #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.quiz-select:focus,
.quiz-input:focus {
  outline: none;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow), 0 0 0 3px #ff5f1f;
}

.quiz-construct-btn {
  height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ff5f1f;
  color: #fff;
  border: 3px solid #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
  cursor: pointer;
  transition: transform 0.08s linear, box-shadow 0.08s linear;
}

.quiz-construct-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 0 var(--brutal-shadow);
}

.quiz-construct-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 var(--brutal-shadow);
}

/* ==========================================================================
   Windowed Pages: Marketplace
   ========================================================================== */

.marketplace-window {
  top: 76px;
  left: calc(50% - 470px);
  width: 940px;
  min-width: 760px;
  min-height: 500px;
}

.marketplace-shell {
  display: grid;
  grid-template-columns: 152px minmax(260px, 340px) minmax(320px, 1fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.windowed-page .marketplace-shell {
  padding-bottom: 24px;
}

.marketplace-sidebar,
.marketplace-browser,
.marketplace-detail {
  min-height: 0;
}

.marketplace-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 3px solid #000;
  padding-right: 12px;
}

.marketplace-category {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: #fff;
  border: 2px solid #000;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: background-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.marketplace-category:hover {
  background: var(--surface-container);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.marketplace-category.active {
  background: var(--primary-container);
  transform: translate(1px, 1px);
  box-shadow: inset 2px 2px 0 0 #000;
}

.marketplace-category .material-symbols-outlined {
  font-size: 22px;
}

.marketplace-category strong {
  font-size: 11px;
}

.marketplace-browser {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.marketplace-search {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.marketplace-search .material-symbols-outlined {
  font-size: 20px;
}

.marketplace-search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.marketplace-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 0 4px 4px 0;
}

.marketplace-item {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: #fff;
  border: 2px solid #000;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  text-align: left;
  cursor: var(--cursor-pointer);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: background-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.marketplace-item:hover {
  background: var(--surface-container);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.marketplace-item.active {
  background: #ffe9e3;
  box-shadow: inset 3px 3px 0 0 #000;
  transform: translate(1px, 1px);
}

.marketplace-item[hidden] {
  display: none;
}

.marketplace-item-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #cae6ff;
  border: 2px solid #000;
  box-shadow: 2px 2px 0 0 #006493;
}

.marketplace-item-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.marketplace-item-copy strong {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.marketplace-item-copy small,
.marketplace-item-copy span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.marketplace-item-price {
  padding: 3px 5px;
  background: #d8f7c5;
  border: 2px solid #000;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.marketplace-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding-left: 12px;
  border-left: 3px solid #000;
  overflow-y: auto;
}

.marketplace-detail-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #fff1a8;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
}

.marketplace-detail-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffdc4a;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 0 #b89600;
  font-size: 32px;
}

.marketplace-detail h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.marketplace-detail p {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.marketplace-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.marketplace-meta-grid div {
  padding: 8px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
}

.marketplace-meta-grid span,
.marketplace-overview h3 {
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.marketplace-meta-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.marketplace-actions {
  display: flex;
  gap: 8px;
}

.marketplace-primary-action,
.marketplace-secondary-action,
.marketplace-tabs button {
  min-height: 36px;
  padding: 0 12px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
  box-shadow: 3px 3px 0 0 var(--brutal-shadow);
  transition: background-color 0.08s linear, transform 0.08s linear, box-shadow 0.08s linear;
}

.marketplace-primary-action {
  background: var(--primary-container);
}

.marketplace-secondary-action {
  background: #cae6ff;
}

.marketplace-primary-action:hover,
.marketplace-secondary-action:hover,
.marketplace-tabs button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.marketplace-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 3px solid #000;
}

.marketplace-tabs button.active {
  background: #000;
  color: #fff;
  box-shadow: none;
  transform: translate(2px, 2px);
}

.marketplace-overview {
  padding: 12px;
  background: #fff;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.marketplace-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.marketplace-tags span {
  padding: 4px 7px;
  background: #d8f7c5;
  border: 2px solid #000;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

/* Windowed Pages: Upload command console variant */
.upload-command-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #000;
  color: #fff;
  border: 4px solid #000;
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
}

.upload-command-header strong {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.upload-command-header span {
  padding: 5px 8px;
  background: #fff;
  color: #000;
  border: 3px solid #000;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-command-header .upload-kicker {
  background: #ff5f1f;
  color: #fff;
}

.upload-console-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  gap: 12px;
}

.upload-drop-zone {
  min-height: 270px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  background:
    linear-gradient(135deg, #ff5f1f 0 49%, #000 49% 51%, #fff 51% 100%);
  color: #000;
  border: 5px solid #000;
  box-shadow: 8px 8px 0 0 var(--brutal-shadow);
  font-family: 'Space Grotesk', sans-serif;
  text-align: left;
  cursor: var(--cursor-pointer);
  transition: transform 0.08s linear, box-shadow 0.08s linear;
}

.upload-drop-zone:hover {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 0 var(--brutal-shadow);
}

.upload-drop-zone.is-dragging-over {
  background:
    linear-gradient(135deg, #8ad957 0 49%, #000 49% 51%, #fff 51% 100%);
  transform: translate(-5px, -5px);
  box-shadow: 13px 13px 0 0 var(--brutal-shadow);
}

.upload-drop-zone:active {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 0 var(--brutal-shadow);
}

.upload-drop-zone > .material-symbols-outlined {
  width: 70px;
  height: 70px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 4px solid #000;
  font-size: 46px;
}

.upload-drop-zone strong {
  max-width: 360px;
  font-size: 54px;
  line-height: 0.88;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.upload-drop-zone small {
  padding: 5px 8px;
  background: #000;
  color: #fff;
  border: 3px solid #000;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.upload-control-stack {
  display: grid;
  gap: 12px;
}

.upload-status-block,
.upload-side-command {
  min-height: 78px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: #fff;
  border: 4px solid #000;
  box-shadow: 5px 5px 0 0 var(--brutal-shadow);
}

.upload-status-block span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.upload-status-block strong {
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.upload-status-accent {
  background: #cae6ff;
}

.upload-side-command {
  min-height: 92px;
  align-items: flex-start;
  background: #ffdc4a;
  color: #000;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
  text-transform: uppercase;
  cursor: var(--cursor-pointer);
}

.upload-side-command:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 0 var(--brutal-shadow);
}

.upload-side-command .material-symbols-outlined {
  font-size: 30px;
}

.upload-popup {
  align-items: stretch;
  justify-content: flex-end;
  padding: 14px;
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.16) 0 10px, rgba(0, 0, 0, 0.24) 10px 20px),
    rgba(39, 24, 19, 0.58);
}

.upload-popup-panel {
  width: min(100%, 440px);
  max-height: none;
  border-width: 5px;
  box-shadow: -8px 8px 0 0 var(--brutal-shadow);
}

.upload-popup-heading h3 {
  padding: 8px 10px;
  display: inline-block;
  background: #ff5f1f;
  color: #fff;
  border: 4px solid #000;
}

/* ==========================================================================
   Windowed Pages: To Do
   ========================================================================== */

/* ----- TODO list ----- */
.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1.5px solid #000;
}

.todo-item:first-child {
  border-top: 1.5px solid #000;
}

.todo-check {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2.5px solid #000;
  background: #fff;
  cursor: var(--cursor-pointer);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  transition: background 0.1s ease;
}

.todo-check .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'wght' 700;
  display: none;
}

.todo-item.completed .todo-check {
  background: #000;
}

.todo-item.completed .todo-check .material-symbols-outlined {
  display: inline-block;
}

.todo-text {
  flex: 1;
  font-size: 15px;
  color: #000;
  outline: none;
  cursor: text;
}

.todo-text:focus {
  background: rgba(255, 95, 31, 0.08);
}

.todo-item.completed .todo-text {
  color: #888;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

/* ----- Add task ----- */
.todo-add {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 4px;
}

.todo-input {
  flex: 1;
  min-height: 56px;
  padding: 12px 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: #000;
  background: #fff;
  border: 2.5px solid #000;
  resize: vertical;
  outline: none;
}

.todo-input::placeholder {
  color: #999;
}

.todo-input:focus {
  box-shadow: inset 0 0 0 1px #000;
}

.todo-add-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 96px;
  padding: 0 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
  background: var(--primary-container);
  border: 2.5px solid #000;
  cursor: var(--cursor-pointer);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.todo-add-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 #000;
}

.todo-add-btn:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.todo-add-btn .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'wght' 700;
}

/* ----- Progress ----- */
.todo-progress {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.todo-progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.todo-progress-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
}

.todo-progress-percent {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--primary-container);
}

.todo-progress-bar {
  position: relative;
  height: 22px;
  background: #fff;
  border: 2.5px solid #000;
  overflow: hidden;
}

.todo-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-container);
  border-right: 2.5px solid #000;
  transition: width 0.3s cubic-bezier(0.25, 1, 0.45, 1);
}

.todo-progress-fill[data-empty="true"] {
  border-right: none;
}

/* ----- Trashcan (skeumorphic neobrutalist) ----- */
.todo-trash {
  flex: 0 0 auto;
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #000;
  border: 2.5px solid #000;
  border-radius: 0;
  cursor: var(--cursor-pointer);
  box-shadow: 2px 2px 0 0 #000;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, color 0.1s ease;
}

.todo-trash::before {
  content: none;
}

.todo-trash::after {
  content: none;
}

.todo-trash .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'wght' 700;
  position: relative;
  z-index: 1;
}

.todo-trash:hover {
  background: var(--primary-container);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 #000;
}

.todo-trash:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

.todo-trash:focus-visible {
  outline: 2px solid var(--primary-container);
  outline-offset: 2px;
}

.todo-item {
  position: relative;
}

.todo-item.removing {
  transform: translateX(40px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

/* ==========================================================================
   Shared UI: Active/Inactive Selection States
   ========================================================================== */

.window.is-inactive,
.window.is-inactive *,
.window.is-inactive *::before,
.window.is-inactive *::after,
.sticky-note.is-inactive,
.sticky-note.is-inactive *,
.sticky-note.is-inactive *::before,
.sticky-note.is-inactive *::after {
  border-color: #686868;
}

.window.is-inactive .window-titlebar,
.sticky-note.is-inactive .sticky-note-header {
  background: #d7d7d7;
  color: #3f3f3f;
  box-shadow: inset 0 -3px 0 0 rgba(104, 104, 104, 0.22);
}

.window.is-inactive,
.window.is-inactive input,
.window.is-inactive textarea,
.window.is-inactive button,
.window.is-inactive output,
.window.is-inactive [contenteditable="true"],
.sticky-note.is-inactive,
.sticky-note.is-inactive input,
.sticky-note.is-inactive textarea,
.sticky-note.is-inactive button,
.sticky-note.is-inactive output,
.sticky-note.is-inactive [contenteditable="true"] {
  color: #575757;
}

.window.is-inactive .calculator-display,
.window.is-inactive .calculator-output,
.window.is-inactive .calculator-expression,
.window.is-inactive .calculator-memory,
.window.is-inactive .pomodoro-time,
.window.is-inactive .pomodoro-session-label,
.window.is-inactive .todo-text,
.window.is-inactive .todo-progress-title,
.window.is-inactive .todo-progress-percent,
.sticky-note.is-inactive .sticky-note-title,
.sticky-note.is-inactive .sticky-note-body,
.sticky-note.is-inactive .sticky-note-body h2,
.sticky-note.is-inactive .sticky-note-body p,
.sticky-note.is-inactive .sticky-note-footer,
.sticky-note.is-inactive .notebook-page-count {
  color: #575757;
}

.window.is-inactive .pomodoro-time {
  text-shadow: 3px 3px 0 #686868;
}

.window.is-inactive .todo-item.completed .todo-text {
  color: #8a8a8a;
}

.window.is-inactive .material-symbols-outlined,
.sticky-note.is-inactive .material-symbols-outlined {
  color: #4f4f4f;
}

.window.is-inactive .window-resize-handle {
  background:
    linear-gradient(135deg, transparent 0 42%, #686868 42% 48%, transparent 48% 56%, #686868 56% 62%, transparent 62% 70%, #686868 70% 76%, transparent 76% 84%, #686868 84% 90%, transparent 90%);
}

.sticky-note.is-inactive .binding-spiral .spiral-loop {
  border-color: #686868;
  background: linear-gradient(180deg, #f5f5f5 0 50%, #b3b3b3 50% 100%);
}

.sticky-note.is-inactive .punched-hole {
  background: radial-gradient(circle at 40% 40%, #555 0 5px, #777 5px 6px, transparent 6px);
}

/* ==========================================================================
   Theme: Main OS Night Mode Component Overrides
   ========================================================================== */

body.main-page.night-mode .window {
  background: #201816;
  color: #ffe9e3;
  border-color: #ff8a3d;
  box-shadow: 8px 8px 0 0 #000, 12px 12px 0 0 rgba(255, 138, 61, 0.2);
}

body.main-page.night-mode .window.is-active {
  box-shadow: 14px 14px 0 0 #000, 20px 20px 0 0 rgba(255, 138, 61, 0.22);
}

body.main-page.night-mode .window-titlebar {
  background: #ff8a3d;
  color: #100b0a;
  border-bottom-color: #000;
}

body.main-page.night-mode .window-body,
body.main-page.night-mode .todo-window .window-body {
  background: #211714;
  color: #ffe9e3;
}

body.main-page.night-mode .window-page-nav,
body.main-page.night-mode .window-page-nav-btn {
  background: #211714;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .window-page-nav {
  box-shadow: 5px 5px 0 0 #000, 8px 8px 0 0 rgba(255, 138, 61, 0.22);
}

body.main-page.night-mode .window-page-nav-btn {
  box-shadow: 4px 4px 0 0 #000;
}

body.main-page.night-mode .window-page-nav-btn:hover {
  background: #35231e;
}

body.main-page.night-mode .window-page-nav-btn:active {
  box-shadow: 2px 2px 0 0 #000;
}

body.main-page.night-mode .todo-item {
  border-color: #6f524a;
}

body.main-page.night-mode .todo-text,
body.main-page.night-mode .todo-progress-title,
body.main-page.night-mode .todo-progress-percent {
  color: #ffe9e3;
}

body.main-page.night-mode .todo-input,
body.main-page.night-mode .todo-check {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .todo-add-btn,
body.main-page.night-mode .todo-progress-fill {
  background: #ff8a3d;
  color: #100b0a;
}

body.main-page.night-mode .todo-progress-bar {
  background: #100b0a;
  border-color: #ff8a3d;
}

body.main-page.night-mode .calculator-window {
  background: #1f2933;
  border-color: #8dcdff;
  box-shadow: 10px 10px 0 0 #000, 15px 15px 0 0 rgba(141, 205, 255, 0.2), inset 4px 4px 0 0 rgba(255, 255, 255, 0.18), inset -5px -5px 0 0 rgba(0, 0, 0, 0.35);
}

body.main-page.night-mode .calculator-window .window-titlebar {
  background: #8dcdff;
  color: #001e30;
}

body.main-page.night-mode .calculator-shell {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 38%),
    #1f2933;
  border-top-color: #8dcdff;
  box-shadow: inset 5px 5px 0 0 rgba(255, 255, 255, 0.16), inset -6px -6px 0 0 rgba(0, 0, 0, 0.34);
}

body.main-page.night-mode .calculator-display {
  background: #26391f;
  border-color: #8dcdff;
  color: #d8f7c5;
  box-shadow: inset 5px 5px 0 0 #10200b, inset -2px -2px 0 0 rgba(255, 255, 255, 0.24);
}

body.main-page.night-mode .calculator-key {
  background: #26313a;
  color: #ffe9e3;
  border-color: #8dcdff;
  box-shadow: 5px 5px 0 0 #000, inset 3px 3px 0 0 rgba(255, 255, 255, 0.16), inset -4px -4px 0 0 rgba(0, 0, 0, 0.24);
}

body.main-page.night-mode .calculator-key-operator {
  background: #004b70;
}

body.main-page.night-mode .calculator-key-clear {
  background: #4a1714;
  color: #ffb4a8;
}

body.main-page.night-mode .calculator-key-equals {
  background: #ff8a3d;
  color: #100b0a;
}

body.main-page.night-mode .pomodoro-window {
  background: #4a1714;
  border-color: #ff8a3d;
  box-shadow: 10px 10px 0 0 #000, 15px 15px 0 0 rgba(255, 95, 31, 0.24), inset 5px 5px 0 0 rgba(255, 255, 255, 0.16), inset -8px -8px 0 0 rgba(0, 0, 0, 0.34);
}

body.main-page.night-mode .pomodoro-window .window-titlebar {
  background: #74be82;
  color: #071b0d;
}

body.main-page.night-mode .pomodoro-shell {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(145deg, #5f1f1a 0%, #42110e 52%, #230807 100%);
  border-top-color: #ff8a3d;
}

body.main-page.night-mode .pomodoro-tomato {
  filter: brightness(0.82) saturate(0.95);
}

body.main-page.night-mode .pomodoro-session-label,
body.main-page.night-mode .pomodoro-mode,
body.main-page.night-mode .pomodoro-control,
body.main-page.night-mode .pomodoro-progress-track {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .pomodoro-start,
body.main-page.night-mode .pomodoro-mode.active,
body.main-page.night-mode .pomodoro-progress-fill {
  background: #74be82;
  color: #071b0d;
}

body.main-page.night-mode .stock-window {
  background: #162113;
  border-color: #8ad957;
}

body.main-page.night-mode .stock-window .window-titlebar {
  background: #8ad957;
  color: #071b0d;
}

body.main-page.night-mode .stock-shell,
body.main-page.night-mode .stock-chart-panel {
  background:
    linear-gradient(135deg, rgba(138, 217, 87, 0.12), transparent 42%),
    #162113;
  color: #f5ffe9;
  border-color: #8ad957;
}

body.main-page.night-mode .stock-symbol-control,
body.main-page.night-mode .stock-strategy-chip,
body.main-page.night-mode .stock-timeframe-chip,
body.main-page.night-mode .stock-stat,
body.main-page.night-mode .stock-backtest-log {
  background: #10170d;
  color: #f5ffe9;
  border-color: #8ad957;
}

body.main-page.night-mode .stock-strategy-chip {
  border-color: #8dcdff;
}

body.main-page.night-mode .stock-timeframe-chip {
  border-color: #ffb84d;
}

body.main-page.night-mode .stock-symbol-select {
  background: #071b0d;
  color: #f5ffe9;
  border-color: #8ad957;
}

body.main-page.night-mode .profile-menu,
body.main-page.night-mode .profile-menu-item,
body.main-page.night-mode .profile-menu-storage,
body.main-page.night-mode .profile-identity,
body.main-page.night-mode .profile-stat,
body.main-page.night-mode .profile-detail-list,
body.main-page.night-mode .profile-detail-row {
  background: #211714;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .profile-menu-user {
  background: #35231e;
  border-color: #ff8a3d;
}

body.main-page.night-mode .profile-storage-refresh {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .profile-widget {
  background: #211714;
  border-color: #ff8a3d;
}

body.main-page.night-mode .profile-widget .window-titlebar,
body.main-page.night-mode .profile-badge,
body.main-page.night-mode .profile-menu-avatar {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .profile-heading span,
body.main-page.night-mode .profile-heading small,
body.main-page.night-mode .profile-stat span,
body.main-page.night-mode .profile-detail-row span,
body.main-page.night-mode .profile-menu-user small,
body.main-page.night-mode .profile-menu-storage small,
body.main-page.night-mode .profile-menu-storage > .material-symbols-outlined {
  color: #d8c1b8;
}

body.main-page.night-mode .stock-chart {
  background:
    linear-gradient(rgba(138, 217, 87, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 217, 87, 0.16) 1px, transparent 1px),
    #071b0d;
  border-color: #8ad957;
}

body.main-page.night-mode .stock-log-row {
  border-color: #5f833f;
}

body.main-page.night-mode .stock-log-head {
  background: #24351d;
  color: #d8f7c5;
}

body.main-page.night-mode .quiz-section {
  background: #2d3f5f;
  color: #e8f4ff;
  border-color: #8dcdff;
}

body.main-page.night-mode .marketplace-sidebar,
body.main-page.night-mode .marketplace-detail {
  border-color: #ff8a3d;
}

body.main-page.night-mode .marketplace-category,
body.main-page.night-mode .marketplace-search,
body.main-page.night-mode .marketplace-item,
body.main-page.night-mode .marketplace-meta-grid div,
body.main-page.night-mode .marketplace-overview {
  background: #211714;
  color: #ffe9e3;
  border-color: #ff8a3d;
  box-shadow: 3px 3px 0 0 #000;
}

body.main-page.night-mode .marketplace-category:hover,
body.main-page.night-mode .marketplace-item:hover {
  background: #35231e;
}

body.main-page.night-mode .marketplace-category.active,
body.main-page.night-mode .marketplace-item.active,
body.main-page.night-mode .marketplace-detail-head {
  background: #ff8a3d;
  color: #100b0a;
  border-color: #000;
}

body.main-page.night-mode .marketplace-search-input {
  color: #ffe9e3;
}

body.main-page.night-mode .marketplace-search-input::placeholder {
  color: #bfa69d;
}

body.main-page.night-mode .marketplace-item-icon,
body.main-page.night-mode .marketplace-detail-icon,
body.main-page.night-mode .marketplace-item-price,
body.main-page.night-mode .marketplace-tags span {
  color: #100b0a;
  border-color: #000;
}

body.main-page.night-mode .quiz-section-label {
  color: #8dcdff;
}

body.main-page.night-mode .quiz-count-display {
  color: #ffb84d;
}

body.main-page.night-mode .quiz-count-slider {
  background: #1d2a3f;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-type-option {
  background: #2d3f5f;
  border-color: #8dcdff;
  color: #e8f4ff;
}

body.main-page.night-mode .quiz-type-checkbox {
  background: #2d3f5f;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-type-option input:checked + .quiz-type-checkbox {
  background: #4caf50;
}

body.main-page.night-mode .quiz-difficulty-btn {
  background: #2d3f5f;
  color: #e8f4ff;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-difficulty-btn.active {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .quiz-option-toggle {
  background: #2d3f5f;
  color: #e8f4ff;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-option-toggle.active {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .quiz-choice-btn {
  background: #2d3f5f;
  color: #e8f4ff;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-choice-btn.active {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .quiz-select,
body.main-page.night-mode .quiz-input {
  background: #2d3f5f;
  color: #e8f4ff;
  border-color: #8dcdff;
}

body.main-page.night-mode .quiz-construct-btn {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .upload-command-header,
body.main-page.night-mode .upload-popup-panel,
body.main-page.night-mode .upload-settings-summary,
body.main-page.night-mode .upload-document-tile,
body.main-page.night-mode .upload-input-container select,
body.main-page.night-mode .upload-input-container input,
body.main-page.night-mode .upload-progress-bar,
body.main-page.night-mode .upload-btn-secondary,
body.main-page.night-mode .upload-btn-text {
  background: #211714;
  color: #ffe9e3;
  border-color: #ffb84d;
}

body.main-page.night-mode .upload-drop-zone {
  background:
    linear-gradient(135deg, #8f4121 0 49%, #ffb84d 49% 51%, #211714 51% 100%);
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .upload-drop-zone > .material-symbols-outlined,
body.main-page.night-mode .upload-status-block,
body.main-page.night-mode .upload-side-command {
  background: #211714;
  color: #ffe9e3;
  border-color: #ffb84d;
}

body.main-page.night-mode .upload-status-accent {
  background: #2f4b5f;
  border-color: #8dcdff;
}

body.main-page.night-mode .upload-drop-zone small,
body.main-page.night-mode .upload-command-header {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ffb84d;
}

body.main-page.night-mode .upload-command-header span {
  background: #35231e;
  color: #ffe9e3;
  border-color: #ffb84d;
}

body.main-page.night-mode .upload-command-header .upload-kicker {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .upload-btn-primary,
body.main-page.night-mode .upload-choice-btn.active {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .upload-choice-btn,
body.main-page.night-mode .upload-icon-btn,
body.main-page.night-mode .upload-option-toggle,
body.main-page.night-mode .upload-card-action {
  background: #35231e;
  color: #ffe9e3;
  border-color: #ffb84d;
}

body.main-page.night-mode .upload-option-toggle.active,
body.main-page.night-mode .upload-option-toggle[aria-pressed="true"] {
  background: #8f4121;
  color: #fff3ec;
  border-color: #ff8a3d;
}

body.main-page.night-mode .upload-popup-heading p,
body.main-page.night-mode .upload-document-size,
body.main-page.night-mode .upload-progress-text {
  color: #d8c1b8;
}

body.main-page.night-mode .upload-document-name {
  color: #ffe9e3;
}

body.main-page.night-mode .sticky-note {
  background-color: var(--note-night-body, #2d211d) !important;
  color: #ffe9e3;
  border-color: #ff8a3d;
  box-shadow: 6px 6px 0 0 #000, 10px 10px 0 0 rgba(255, 138, 61, 0.18);
  filter: none;
}

body.main-page.night-mode .sticky-note.is-active {
  box-shadow: 11px 11px 0 0 #000, 16px 16px 0 0 rgba(255, 138, 61, 0.22);
}

body.main-page.night-mode .sticky-note-header {
  background: var(--note-night-header, #8f4121) !important;
  color: #fff3ec;
  border-bottom-color: #000;
}

body.main-page.night-mode .sticky-note-body,
body.main-page.night-mode .sticky-note-body h2,
body.main-page.night-mode .sticky-note-body p,
body.main-page.night-mode .sticky-note-footer,
body.main-page.night-mode .sticky-note-title {
  color: #ffe9e3;
}

body.main-page.night-mode .sticky-note.bound-file {
  background: #2a1710 !important;
  border-color: #ff8a3d;
  box-shadow: 7px 7px 0 0 #000, 12px 12px 0 0 rgba(255, 138, 61, 0.18);
}

body.main-page.night-mode .sticky-note.bound-file .sticky-note-body h2,
body.main-page.night-mode .sticky-note.bound-file .notebook-page-count {
  background: #100b0a;
  color: #ffe9e3;
  border-color: #ff8a3d;
}

body.main-page.night-mode .context-menu,
body.main-page.night-mode .todo-context-menu,
body.main-page.night-mode .calculator-context-menu {
  background: #211714;
  color: #ffe9e3;
  border-color: #ff8a3d;
  box-shadow: 6px 6px 0 0 #000;
}

body.main-page.night-mode .context-menu-item,
body.main-page.night-mode .todo-context-item,
body.main-page.night-mode .calculator-context-item {
  color: #ffe9e3;
}

body.main-page.night-mode .context-menu-item:hover,
body.main-page.night-mode .todo-context-item:hover,
body.main-page.night-mode .calculator-context-item:hover {
  background: #35231e;
  border-color: #ff8a3d;
}

body.main-page.night-mode .top-bar,
body.main-page.night-mode .brand-logo,
body.main-page.night-mode .top-nav a,
body.main-page.night-mode .top-nav-dropdown,
body.main-page.night-mode .top-nav-dropdown-item,
body.main-page.night-mode .bottom-nav,
body.main-page.night-mode .bottom-nav-item,
body.main-page.night-mode .datetime-display,
body.main-page.night-mode .icon-btn,
body.main-page.night-mode .user-avatar,
body.main-page.night-mode .window,
body.main-page.night-mode .window.is-active,
body.main-page.night-mode .window.is-inactive,
body.main-page.night-mode .window-btn,
body.main-page.night-mode .sticky-note,
body.main-page.night-mode .sticky-note.is-active,
body.main-page.night-mode .sticky-note.is-inactive,
body.main-page.night-mode .sticky-note-close,
body.main-page.night-mode .sticky-note.bound-file,
body.main-page.night-mode .sticky-note.bound-file.is-active,
body.main-page.night-mode .sticky-note.bound-file.is-inactive,
body.main-page.night-mode .calculator-window,
body.main-page.night-mode .calculator-window.is-active,
body.main-page.night-mode .calculator-window.is-inactive,
body.main-page.night-mode .calculator-shell,
body.main-page.night-mode .calculator-display,
body.main-page.night-mode .calculator-key,
body.main-page.night-mode .pomodoro-window,
body.main-page.night-mode .pomodoro-window.is-active,
body.main-page.night-mode .pomodoro-window.is-inactive,
body.main-page.night-mode .pomodoro-shell,
body.main-page.night-mode .pomodoro-tomato,
body.main-page.night-mode .pomodoro-session-label,
body.main-page.night-mode .pomodoro-mode,
body.main-page.night-mode .pomodoro-control,
body.main-page.night-mode .pomodoro-progress-track,
body.main-page.night-mode .todo-add-btn,
body.main-page.night-mode .todo-progress-bar,
body.main-page.night-mode .stock-window,
body.main-page.night-mode .stock-window.is-active,
body.main-page.night-mode .stock-window.is-inactive,
body.main-page.night-mode .profile-widget,
body.main-page.night-mode .profile-widget.is-active,
body.main-page.night-mode .profile-widget.is-inactive,
body.main-page.night-mode .stock-symbol-control,
body.main-page.night-mode .stock-strategy-chip,
body.main-page.night-mode .stock-timeframe-chip,
body.main-page.night-mode .stock-stat,
body.main-page.night-mode .stock-chart-panel,
body.main-page.night-mode .stock-backtest-log,
body.main-page.night-mode .profile-menu,
body.main-page.night-mode .profile-menu-item,
body.main-page.night-mode .profile-menu-user,
body.main-page.night-mode .profile-menu-storage,
body.main-page.night-mode .profile-storage-refresh,
body.main-page.night-mode .profile-menu-avatar,
body.main-page.night-mode .profile-identity,
body.main-page.night-mode .profile-badge,
body.main-page.night-mode .profile-stat,
body.main-page.night-mode .profile-detail-list,
body.main-page.night-mode .upload-command-header,
body.main-page.night-mode .upload-drop-zone,
body.main-page.night-mode .upload-status-block,
body.main-page.night-mode .upload-side-command,
body.main-page.night-mode .upload-popup-panel,
body.main-page.night-mode .context-menu,
body.main-page.night-mode .todo-context-menu,
body.main-page.night-mode .calculator-context-menu,
body.main-page.night-mode .notebook-marker,
body.main-page.night-mode .spiral-loop,
body.main-page.night-mode .punched-hole {
  box-shadow: none;
}

/* ==========================================================================
   Context Menus: Window Local Menus
   ========================================================================== */

/* ----- Window context menu ----- */
.todo-context-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  min-width: 200px;
  background: #fff;
  border: 2.5px solid #000;
  box-shadow: 4px 4px 0 0 #000;
  z-index: 200;
  font-family: 'Space Grotesk', sans-serif;
  padding: 4px;
}

.todo-context-menu[data-state="visible"] {
  display: flex;
}

.todo-context-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 2px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #000;
  cursor: var(--cursor-pointer);
  text-align: left;
}

.todo-context-item:hover {
  background: var(--primary-container);
  border-color: #000;
  color: #000;
}

.todo-context-item .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'wght' 700;
}
