/* ================================================
   YancoTab v2 — main.css (cleaned)
   App-specific styles + window chrome + layout.
   Shell, tokens, reset, icons → separate files.
   ================================================ */

body {
  margin: 0;
  font-family: "Inter", "SF Pro Display", "Segoe UI", sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(12, 32, 64, 0.9), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(11, 77, 100, 0.8), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(62, 32, 108, 0.8), transparent 55%),
    linear-gradient(135deg, #050910 0%, #081321 40%, #04161f 100%);
  overflow: hidden;
  color: var(--text-primary);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body.is-mobile {
  overflow: hidden;
  --dock-btn-size: 48px;
  --dock-pad-y: 12px;
  --dock-pad-x: 16px;
}

body.is-mobile #app {
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

body.is-mobile.is-landscape {
  overflow: hidden;
}

body.is-mobile.is-landscape #app {
  overflow: hidden;
}

input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

body.time-dawn {
  background:
    radial-gradient(circle at 20% 20%, rgba(80, 120, 200, 0.45), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(120, 160, 220, 0.35), transparent 60%),
    linear-gradient(135deg, #091326 0%, #0d1b2d 45%, #0a1422 100%);
}

body.time-morning {
  background:
    radial-gradient(circle at 20% 20%, rgba(120, 180, 255, 0.35), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(160, 210, 255, 0.25), transparent 60%),
    linear-gradient(135deg, #0a1426 0%, #0f1e30 45%, #0b1726 100%);
}

body.time-afternoon {
  background:
    radial-gradient(circle at 20% 20%, rgba(90, 170, 210, 0.28), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(70, 130, 190, 0.2), transparent 60%),
    linear-gradient(135deg, #07111c 0%, #0a1724 45%, #07131f 100%);
}

body.time-evening {
  background:
    radial-gradient(circle at 20% 20%, rgba(140, 100, 200, 0.28), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(120, 90, 170, 0.2), transparent 60%),
    linear-gradient(135deg, #0a0f1a 0%, #111521 45%, #0a101b 100%);
}

body.time-night {
  background:
    radial-gradient(circle at 20% 20%, rgba(10, 18, 32, 0.95), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(9, 36, 46, 0.85), transparent 60%),
    radial-gradient(circle at 50% 80%, rgba(30, 24, 64, 0.85), transparent 55%),
    linear-gradient(135deg, #03060d 0%, #06101a 45%, #041015 100%);
}

body.theme-light {
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(200, 225, 255, 0.7), transparent 60%),
    linear-gradient(135deg, #f1f6ff 0%, #dbe7f7 60%, #cfdaf2 100%);
  color: var(--text-primary);
  color-scheme: light;
  --text-primary: #0e141b;
  --text-muted: rgba(14, 20, 27, 0.65);
  --bg-color: rgba(255, 255, 255, 0.6);
  --bg-blur: 20px;
  --border-color: rgba(0, 0, 0, 0.1);
  --dock-bg: rgba(255, 255, 255, 0.4);
  --glass-surface-1: rgba(255, 255, 255, 0.62);
  --glass-surface-2: rgba(236, 244, 255, 0.74);
  --glass-surface-3: rgba(224, 236, 252, 0.92);
  --border-light: rgba(17, 43, 82, 0.2);
  --border-medium: rgba(17, 43, 82, 0.16);
}

.app {
  position: relative;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* ── Window container ── */
/* Window container - persists across shell rerenders */
#app-windows {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
}

#app-windows .placeholder-window {
  pointer-events: auto;
}

/* Shell container - sits above starfield canvas */
#app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-image: url('../assets/wallpapers/emerald.webp');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

/* Cosmic mode: wallpaper fades to reveal starfield canvas beneath */
#app-shell.cosmic-wallpaper {
  opacity: 0.55;
}

/* ── Placeholder window chrome ── */
.placeholder-window {
  position: absolute;
  width: 360px;
  min-height: 240px;
  height: auto;
  padding: 16px;
  border-radius: 24px;
  background: rgba(6, 14, 28, 0.72);
  border: 1px solid rgba(122, 182, 255, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: var(--surface-text);
  backdrop-filter: blur(16px);
}

.placeholder-window h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.placeholder-window p {
  margin: 0;
  opacity: 0.7;
  font-size: 13px;
}

@media (max-width: 720px) {
  body:not(.is-mobile) .weather {
    display: none;
  }

  body:not(.is-mobile) .dock {
    bottom: 24px;
  }

  body:not(.is-mobile) .clock {
    top: 24px;
    right: 24px;
  }
}

/* Window chrome */
.placeholder-window {
  padding: 0;
  position: absolute;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: move;
  user-select: none;
  background: rgba(6, 14, 28, 0.6);
  border-bottom: 1px solid rgba(122, 182, 255, 0.25);
}

.window-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

.window-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.window-close:hover {
  background: rgba(255, 80, 80, 0.25);
  border-color: rgba(255, 80, 80, 0.6);
  transform: scale(1.05);
}

.window-body {
  padding: 16px;
}

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

.window-min,
.window-max {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.window-min:hover,
.window-max:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.placeholder-window.is-minimized {
  display: none;
}

.placeholder-window.is-maximized {
  border-radius: 0;
}

/* ── Settings App ── */
.settings-layout {
  display: grid;
  gap: 14px;
}

.settings-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(8, 18, 34, 0.6);
  border: none;
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.25),
    inset 0 0 0 3px rgba(var(--accent-rgb), 0.06);
  min-height: 0;
}

.settings-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(5, 14, 26, 0.6);
  color: inherit;
  font-size: 12px;
  outline: none;
}

.settings-search::placeholder {
  color: var(--surface-muted);
}

.settings-nav {
  display: grid;
  gap: 6px;
}

.settings-nav-btn {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: left;
}

.settings-nav-btn.is-active {
  background: rgba(120, 200, 255, 0.2);
  border-color: rgba(120, 200, 255, 0.45);
}

.settings-nav-btn.is-disabled {
  opacity: 0.35;
  cursor: default;
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 6px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-section-header {
  display: grid;
  gap: 4px;
}

.settings-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.8;
}

.settings-section-subtitle {
  font-size: 12px;
  opacity: 0.6;
}

.settings-card-grid {
  display: grid;
  gap: 12px;
}

.settings-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.25),
    inset 0 0 0 2.5px rgba(var(--accent-rgb), 0.06);
  display: grid;
  gap: 12px;
}

.settings-card-header {
  display: grid;
  gap: 4px;
}

.settings-card-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.settings-card-desc {
  font-size: 11px;
  opacity: 0.6;
}

.settings-card-body {
  display: grid;
  gap: 10px;
}

.settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.settings-item-label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-item-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.settings-item-subtitle {
  font-size: 11px;
  opacity: 0.6;
}

.settings-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 920px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }

  .settings-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .settings-nav {
    grid-auto-flow: column;
    grid-auto-columns: minmax(120px, 1fr);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .settings-nav-btn {
    text-align: center;
  }
}

@media (max-width: 640px) {
  .settings-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .settings-item-actions {
    justify-content: flex-start;
  }
}

.settings-pill {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-about {
  display: grid;
  gap: 6px;
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.4;
}

.settings-about-block {
  display: grid;
  gap: 6px;
}

.settings-about-block+.settings-about-block {
  margin-top: 10px;
}

.settings-about-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.settings-about-line {
  word-break: break-word;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(140, 210, 255, 0.2);
}

.settings-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.settings-helper {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--surface-muted);
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-weather-city {
  position: relative;
  flex-wrap: wrap;
}

.settings-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(6, 14, 28, 0.95);
  border: 1px solid rgba(140, 210, 255, 0.2);
  border-radius: 12px;
  padding: 6px;
  display: none;
  z-index: 5;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.settings-suggestions.is-open {
  display: grid;
  gap: 4px;
}

.settings-suggestion {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.settings-clock-actions {
  position: relative;
  flex-wrap: wrap;
}


.settings-suggestion:hover {
  border-color: rgba(120, 190, 255, 0.4);
  background: rgba(120, 190, 255, 0.12);
}

.settings-input {
  width: 160px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(5, 14, 26, 0.6);
  color: inherit;
  font-size: 12px;
  outline: none;
}

.settings-range {
  width: 160px;
  accent-color: #6fe3ff;
  padding: 0;
  height: 28px;
}

.settings-select {
  min-width: 120px;
}

.settings-input::placeholder {
  color: var(--surface-muted);
}

.toggle-wrap {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

.theme-toggle {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(140, 210, 255, 0.3);
  transition: background 0.2s ease;
}

.toggle-ui::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 2px;
  border-radius: 999px;
  background: #e6f7ff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.theme-toggle:checked+.toggle-ui {
  background: rgba(120, 200, 255, 0.45);
}

.theme-toggle:checked+.toggle-ui::after {
  transform: translateX(20px);
}

.settings-button {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.settings-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.viewer-layout {
  display: grid;
  place-items: center;
  min-height: 240px;
}

.viewer-image {
  max-width: 100%;
  max-height: 320px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

.editor-area {
  width: 100%;
  min-height: 240px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(6, 14, 28, 0.6);
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.top-logo {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #cdefff 45%, #7ec7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 -1px 1px rgba(255, 255, 255, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.smart-search {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
}

.smart-search-input {
  width: min(420px, 60vw);
  border: none;
  background: transparent;
  color: inherit;
  font-size: 13px;
  outline: none;
}

.smart-search-input::placeholder {
  color: var(--surface-muted);
}

.smart-search-button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.smart-search-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.portal-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.portal-add {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.portal-add:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.speed-dial-btn.glass-bubble {
  padding: 10px 12px;
  border-radius: 16px;
}

.creator-layout {
  display: grid;
  gap: 12px;
}

.dock-emoji {
  font-size: 20px;
  line-height: 1;
}

.memory-game {
  display: grid;
  gap: 12px;
}

.memory-status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
}

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

.memory-card {
  position: relative;
  height: 60px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.2);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.memory-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
}

.memory-card .memory-face {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.memory-card.is-flipped .memory-face,
.memory-card.is-matched .memory-face {
  opacity: 1;
  transform: scale(1);
}

.memory-card.is-matched {
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.6),
    inset 0 0 0 3px rgba(var(--accent-rgb), 0.15),
    0 8px 20px rgba(var(--accent-rgb), 0.25);
}

.smart-search {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 999px;
  min-width: min(680px, 90vw);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.smart-search-input {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  outline: none;
}

.smart-search-input::placeholder {
  color: var(--surface-muted);
}

.smart-search-button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(140, 210, 255, 0.35);
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.smart-search-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.24);
}

.top-logo {
  position: fixed;
  top: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #cdefff 45%, #7ec7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 -1px 1px rgba(255, 255, 255, 0.55),
    0 12px 22px rgba(0, 0, 0, 0.55),
    0 0 30px rgba(120, 220, 255, 0.25);
  pointer-events: none;
}

.portal-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.portal-add {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.portal-add:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.2);
}

.speed-dial-btn.glass-bubble {
  padding: 10px 12px;
  border-radius: 16px;
}

.creator-layout {
  display: grid;
  gap: 12px;
}

/* Legacy .dock-icon removed — handled by shell.css */

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

.game-tile {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  padding: 14px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.25),
    inset 0 0 0 2.5px rgba(var(--accent-rgb), 0.06);
  display: grid;
  gap: 8px;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.game-tile:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.4),
    inset 0 0 0 3px rgba(var(--accent-rgb), 0.1),
    0 0 15px rgba(var(--accent-rgb), 0.08);
}

.game-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

.game-label {
  font-size: 11px;
  letter-spacing: 0.1em;
}

.portal-frame-wrap {
  width: 100%;
  min-height: 360px;
}

.portal-frame {
  width: 100%;
  height: 360px;
  border: none;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.context-menu {
  position: fixed;
  z-index: 12000;
  min-width: 160px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(10, 18, 32, 0.72);
  border: 1px solid rgba(140, 210, 255, 0.25);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
}

.context-item {
  width: 100%;
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.context-item:hover {
  background: rgba(255, 255, 255, 0.12);
}


/* ── Portal/Speed-dial ── */
.portal-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.portal-search {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(140, 210, 255, 0.35);
  background: rgba(5, 14, 26, 0.6);
  color: inherit;
  font-size: 14px;
  box-shadow:
    0 0 18px rgba(62, 200, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  outline: none;
}

.portal-search::placeholder {
  color: var(--surface-muted);
}

.speed-dial {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.speed-dial-btn {
  border: 1px solid rgba(140, 210, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

.speed-dial-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

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

.file-folder-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 12px 0;
}

.file-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.25),
    inset 0 0 0 2.5px rgba(var(--accent-rgb), 0.06);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: inherit;
  text-align: left;
  transition: transform 0.2s ease, background 0.2s ease;
}

.file-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.4),
    inset 0 0 0 3px rgba(var(--accent-rgb), 0.1),
    0 0 12px rgba(var(--accent-rgb), 0.06);
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
  font-size: 18px;
}

.file-name {
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




/* ── Browser App V2 ── */
/* ---------- Browser App V2 (New-Tab Native) ---------- */
/* ── Browser App v2.0 — Modern New Tab ── */
.app-browser-v2 {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #eaf1ff;
  font-family: "Space Grotesk", "Avenir Next", "SF Pro Display", system-ui, sans-serif;
  background: #000;
}

.app-browser-v2 .bb-shell {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-browser-v2 .bb-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.app-browser-v2 .bb-theme-aurora::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(96, 144, 255, 0.3), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(90, 228, 214, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(94, 240, 176, 0.12), transparent 50%);
}

.app-browser-v2 .bb-theme-graphite::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(144, 156, 186, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(102, 126, 174, 0.14), transparent 50%);
}

.app-browser-v2 .bb-theme-midnight::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(122, 84, 211, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(46, 98, 212, 0.18), transparent 50%);
}

/* ── Scroll ── */
.app-browser-v2 .bb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px max(24px, calc(env(safe-area-inset-bottom, 0px) + 20px));
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}

/* ── Command Bar ── */
@keyframes bb-cmd-enter {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-browser-v2 .bb-command {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 16px;
  padding: 0 6px 0 16px;
  height: 48px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
  animation: bb-cmd-enter 0.4s var(--ease-out);
}

.app-browser-v2 .bb-command:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.1), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.app-browser-v2 .bb-cmd-icon {
  font-size: 15px;
  opacity: 0.4;
  flex-shrink: 0;
  line-height: 1;
}

.app-browser-v2 .bb-cmd-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  padding: 0;
  outline: none;
  height: 100%;
}

.app-browser-v2 .bb-cmd-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.app-browser-v2 .bb-cmd-engines {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.app-browser-v2 .bb-cmd-engine {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.app-browser-v2 .bb-cmd-engine:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.app-browser-v2 .bb-cmd-engine.is-active {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.3);
  color: var(--accent);
}

/* ── Greeting ── */
@keyframes bb-greet-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-browser-v2 .bb-greeting {
  text-align: center;
  padding: clamp(8px, 3vh, 24px) 0;
  animation: bb-greet-enter 0.5s var(--ease-out) 0.1s backwards;
}

.app-browser-v2 .bb-time {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 200;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.app-browser-v2 .bb-greet-text {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

/* ── Section Header ── */
.app-browser-v2 .bb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  margin-bottom: 12px;
}

.app-browser-v2 .bb-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.app-browser-v2 .bb-section-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
}

/* ── Cards Section ── */
.app-browser-v2 .bb-cards-section {
  max-width: 100%;
}

.app-browser-v2 .bb-cards-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 12px;
  scrollbar-width: none;
}

.app-browser-v2 .bb-cards-track::-webkit-scrollbar {
  display: none;
}

/* ── Bookmark Card ── */
@keyframes bb-card-enter {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-browser-v2 .bb-card {
  flex-shrink: 0;
  width: 148px;
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  position: relative;
  scroll-snap-align: start;
  transition: transform 0.35s var(--ease-spring), border-color 0.25s, background 0.25s, box-shadow 0.25s;
  animation: bb-card-enter 0.5s var(--ease-out) backwards;
  -webkit-tap-highlight-color: transparent;
}

.app-browser-v2 .bb-card:nth-child(1) { animation-delay: 0.05s; }
.app-browser-v2 .bb-card:nth-child(2) { animation-delay: 0.1s; }
.app-browser-v2 .bb-card:nth-child(3) { animation-delay: 0.15s; }
.app-browser-v2 .bb-card:nth-child(4) { animation-delay: 0.2s; }
.app-browser-v2 .bb-card:nth-child(5) { animation-delay: 0.25s; }
.app-browser-v2 .bb-card:nth-child(6) { animation-delay: 0.3s; }
.app-browser-v2 .bb-card:nth-child(n+7) { animation-delay: 0.35s; }

.app-browser-v2 .bb-card:hover {
  transform: translateY(-4px) scale(1.04);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow:
    0 0 20px rgba(var(--accent-rgb), 0.12),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.app-browser-v2 .bb-card:active {
  transform: scale(0.97);
  transition-duration: 0.1s;
}

.app-browser-v2 .bb-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.app-browser-v2 .bb-card-favicon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
}

.app-browser-v2 .bb-card-label {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: rgba(255, 255, 255, 0.9);
}

.app-browser-v2 .bb-card-domain {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  margin-top: auto;
}

.app-browser-v2 .bb-card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 70, 70, 0.2);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  display: grid;
  place-items: center;
}

.app-browser-v2 .bb-card-remove:hover {
  background: rgba(255, 70, 70, 0.4);
  color: #fff;
}

.app-browser-v2 .bb-card:hover .bb-card-remove {
  opacity: 1;
}

/* ── Add Card ── */
.app-browser-v2 .bb-card-add {
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.2);
  background: rgba(var(--accent-rgb), 0.03);
  justify-content: center;
}

.app-browser-v2 .bb-card-add:hover {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.08);
}

.app-browser-v2 .bb-card-add-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px dashed rgba(var(--accent-rgb), 0.3);
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 300;
  color: rgba(var(--accent-rgb), 0.5);
  transition: color 0.2s, border-color 0.2s;
}

.app-browser-v2 .bb-card-add:hover .bb-card-add-icon {
  color: rgba(var(--accent-rgb), 0.8);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.app-browser-v2 .bb-card-add .bb-card-label {
  color: rgba(var(--accent-rgb), 0.5);
}

/* ── Toolbar ── */
.app-browser-v2 .bb-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.app-browser-v2 .bb-tool-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  min-height: 36px;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.app-browser-v2 .bb-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Recent Strip ── */
.app-browser-v2 .bb-recent-section {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

.app-browser-v2 .bb-recent-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  scrollbar-width: none;
}

.app-browser-v2 .bb-recent-track::-webkit-scrollbar {
  display: none;
}

.app-browser-v2 .bb-recent-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.app-browser-v2 .bb-recent-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(var(--accent-rgb), 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.08);
}

.app-browser-v2 .bb-chip-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: none;
}

.app-browser-v2 .bb-chip-host {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-browser-v2 .bb-empty {
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  min-height: 60px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .app-browser-v2 .bb-card {
    width: 130px;
    min-height: 160px;
  }
  .app-browser-v2 .bb-greeting {
    padding: 4px 0;
  }
}

@media (orientation: landscape) and (max-width: 980px) {
  .app-browser-v2 .bb-greeting {
    padding: 4px 0;
  }
}


/* ── Clock App — Aurora v2 ── */

/* Container */
.clk {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 229, 193, 0.08), transparent 60%),
    linear-gradient(180deg, rgba(10, 16, 28, 0.97) 0%, rgba(6, 10, 18, 0.99) 100%);
  color: #fff;
  font-family: var(--font-sans, 'Inter', sans-serif);
  position: relative;
  transition: background 1s ease;
}

/* Time-of-day theme shifts */
.clk[data-clock-theme="dawn"] {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 160, 90, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(18, 14, 26, 0.97) 0%, rgba(10, 10, 18, 0.99) 100%);
}
.clk[data-clock-theme="morning"] {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(140, 220, 255, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(10, 18, 32, 0.97) 0%, rgba(6, 10, 18, 0.99) 100%);
}
.clk[data-clock-theme="afternoon"] {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 180, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(12, 18, 30, 0.97) 0%, rgba(6, 10, 18, 0.99) 100%);
}
.clk[data-clock-theme="sunset"] {
  background:
    radial-gradient(ellipse at 50% 10%, rgba(255, 120, 80, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(20, 12, 28, 0.97) 0%, rgba(8, 6, 14, 0.99) 100%);
}
.clk[data-clock-theme="evening"] {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(100, 120, 200, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(12, 14, 24, 0.97) 0%, rgba(6, 8, 14, 0.99) 100%);
}

/* ── Segmented Control ── */
.clk-seg {
  display: flex;
  gap: 2px;
  padding: 12px 20px 0;
  flex-shrink: 0;
  justify-content: center;
}

.clk-seg__btn {
  flex: 1;
  max-width: 120px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.clk-seg__btn:first-child { border-radius: 8px 0 0 8px; }
.clk-seg__btn:last-child { border-radius: 0 8px 8px 0; }

.clk-seg__btn.is-active {
  background: var(--accent, #00e5c1);
  color: #0a101c;
  border-color: var(--accent, #00e5c1);
}

.clk-seg__btn:not(.is-active):hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Content ── */
.clk-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 20px 20px;
}

.clk-content.is-switching {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Hero Clock (World Tab) ── */
.clk-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 0 12px;
  min-height: 120px;
}

.clk-hero__time {
  display: flex;
  align-items: baseline;
  gap: 2px;
  white-space: nowrap;
}

.clk-hero__hm {
  font-size: 72px;
  font-weight: 200;
  letter-spacing: -3px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.95);
}

.clk-hero__sec {
  font-size: 28px;
  font-weight: 300;
  color: var(--accent, #00e5c1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.clk-hero__ampm {
  font-size: 18px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  margin-left: 6px;
}

.clk-hero__date {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ── Analog Clock ── */
.clk-analog {
  width: 220px;
  height: 220px;
}

.clk-analog-pill {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Face Toggle ── */
.clk-face-toggle {
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 16px;
}

.clk-face-toggle__btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.clk-face-toggle__btn:first-child { border-radius: 6px 0 0 6px; }
.clk-face-toggle__btn:last-child { border-radius: 0 6px 6px 0; }

.clk-face-toggle__btn.is-active {
  background: rgba(0, 229, 193, 0.15);
  color: var(--accent, #00e5c1);
  border-color: rgba(0, 229, 193, 0.3);
}

/* ── Section Header ── */
.clk-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.clk-section-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clk-section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.clk-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-tool-btn.is-active {
  background: rgba(0, 229, 193, 0.15);
  color: var(--accent, #00e5c1);
  border-color: rgba(0, 229, 193, 0.3);
}

.clk-add-btn {
  background: rgba(0, 229, 193, 0.1);
  border: 1px solid rgba(0, 229, 193, 0.2);
  color: var(--accent, #00e5c1);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-add-btn:hover {
  background: rgba(0, 229, 193, 0.2);
}

/* ── Search ── */
.clk-search {
  display: flex;
  align-items: center;
  position: relative;
  padding: 8px 0;
}

.clk-search__input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.clk-search__input:focus {
  border-color: rgba(0, 229, 193, 0.4);
}

.clk-search__input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.clk-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(14, 20, 32, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 8px 8px;
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  display: none;
}

.clk-suggestions.is-open { display: block; }

.clk-suggestion {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.clk-suggestion:hover {
  background: rgba(0, 229, 193, 0.08);
}

/* ── World Clock List ── */
.clk-world-list {
  flex: 1;
  overflow-y: auto;
}

.clk-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 13px;
  padding: 32px 0;
}

.clk-world-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.clk-world-row:hover {
  background: rgba(255, 255, 255, 0.02);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
}

.clk-world-row__left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.clk-world-row__city {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clk-world-row__pin-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent, #00e5c1);
  background: rgba(0, 229, 193, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.clk-world-row__offset {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

.clk-world-row__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.clk-world-row__time {
  font-size: 26px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: -0.5px;
}

.clk-world-row__actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.clk-world-row:hover .clk-world-row__actions {
  opacity: 1;
}

/* Always show actions on touch devices */
@media (hover: none) {
  .clk-world-row__actions { opacity: 1; }
}

.clk-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
}

.clk-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.clk-icon-btn.is-active {
  color: var(--accent, #00e5c1);
  background: rgba(0, 229, 193, 0.15);
}

.clk-icon-btn--danger:hover {
  background: rgba(255, 71, 87, 0.2);
  color: #ff4757;
}

/* ── Alarm Tab ── */
.clk-alarm {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 16px;
}

.clk-alarm__next {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding: 4px 0 8px;
}

.clk-alarm__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clk-alarm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-alarm-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.clk-alarm-row.is-disabled {
  opacity: 0.4;
}

.clk-alarm-row__left {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.clk-alarm-row__time {
  font-size: 36px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -1px;
}

.clk-alarm-row__ampm {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.clk-alarm-row__mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
  margin-right: 8px;
}

.clk-alarm-row__label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.clk-alarm-row__days {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Toggle Switch ── */
.clk-toggle {
  width: 46px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  border: none;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
}

.clk-toggle.is-on {
  background: var(--accent, #00e5c1);
}

.clk-toggle__knob {
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.3s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.clk-toggle.is-on .clk-toggle__knob {
  transform: translateX(18px);
}

/* ── Alarm Editor ── */
.clk-alarm-editor {
  background: rgba(14, 20, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.clk-alarm-editor__inputs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.clk-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.clk-input:focus {
  border-color: rgba(0, 229, 193, 0.4);
}

.clk-alarm-editor__days {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.clk-day-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-day-chip.is-active {
  background: var(--accent, #00e5c1);
  color: #0a101c;
  border-color: var(--accent, #00e5c1);
}

.clk-alarm-editor__snooze {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.clk-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #fff;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}

.clk-range {
  -webkit-appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
}

.clk-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent, #00e5c1);
  border-radius: 50%;
  cursor: pointer;
}

.clk-alarm-editor__actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.clk-btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-btn--primary {
  background: var(--accent, #00e5c1);
  color: #0a101c;
}

.clk-btn--primary:hover { filter: brightness(1.1); }

.clk-btn--danger {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

.clk-btn--danger:hover { background: rgba(255, 71, 87, 0.25); }

.clk-alarm__add {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px dashed rgba(0, 229, 193, 0.25);
  border-radius: 10px;
  color: var(--accent, #00e5c1);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-alarm__add:hover {
  background: rgba(0, 229, 193, 0.06);
  border-color: rgba(0, 229, 193, 0.4);
}

.clk-alarm__footer {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.clk-alarm__setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* ── Stopwatch Tab ── */
.clk-stopwatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

.clk-sw-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding: 32px 0;
}

.clk-sw-display__main {
  font-size: 56px;
  font-weight: 200;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  color: rgba(255, 255, 255, 0.95);
}

.clk-sw-display__cs {
  font-size: 28px;
  font-weight: 300;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  color: var(--accent, #00e5c1);
}

.clk-mono {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

/* ── Shared Controls ── */
.clk-controls {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-bottom: 24px;
}

.clk-circle-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.clk-circle-btn--start {
  background: rgba(0, 229, 193, 0.15);
  color: var(--accent, #00e5c1);
  border: 2px solid rgba(0, 229, 193, 0.3);
}

.clk-circle-btn--start:hover {
  background: rgba(0, 229, 193, 0.25);
}

.clk-circle-btn--stop {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
  border: 2px solid rgba(255, 71, 87, 0.3);
}

.clk-circle-btn--stop:hover {
  background: rgba(255, 71, 87, 0.25);
}

.clk-circle-btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.clk-circle-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.clk-circle-btn--secondary.is-disabled {
  opacity: 0.3;
  cursor: default;
}

/* ── Laps ── */
.clk-laps {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.clk-laps__header {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clk-laps__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 10px 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.clk-laps__row--best { color: var(--accent, #00e5c1); }
.clk-laps__row--worst { color: rgba(255, 71, 87, 0.7); }

/* ── Timer Tab ── */
.clk-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
}

.clk-timer__presets {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 8px 0 20px;
  flex-wrap: wrap;
}

.clk-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.clk-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.clk-pill.is-active {
  background: rgba(0, 229, 193, 0.15);
  color: var(--accent, #00e5c1);
  border-color: rgba(0, 229, 193, 0.3);
}

/* Ring */
.clk-timer__ring-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px;
}

.clk-timer__ring {
  width: 100%;
  height: 100%;
}

.clk-timer__arc {
  transition: stroke-dashoffset 0.3s linear;
}

.clk-timer__time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 40px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -1px;
}

.clk-timer__time.is-done {
  color: var(--accent, #00e5c1);
  font-size: 32px;
  font-weight: 600;
  animation: clk-pulse 1s ease-in-out infinite alternate;
}

@keyframes clk-pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* ── Light Mode ── */
body.theme-light .clk {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 122, 255, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(245, 245, 250, 0.98) 0%, rgba(240, 240, 245, 0.99) 100%);
  color: #1a1a2e;
}

body.theme-light .clk-seg__btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .clk-seg__btn.is-active {
  background: var(--accent, #007AFF);
  color: #fff;
  border-color: var(--accent, #007AFF);
}

body.theme-light .clk-hero__hm { color: rgba(0, 0, 0, 0.85); }
body.theme-light .clk-hero__sec { color: var(--accent, #007AFF); }
body.theme-light .clk-hero__ampm { color: rgba(0, 0, 0, 0.35); }
body.theme-light .clk-hero__date { color: rgba(0, 0, 0, 0.4); }

body.theme-light .clk-world-row__city { color: rgba(0, 0, 0, 0.85); }
body.theme-light .clk-world-row__time { color: rgba(0, 0, 0, 0.75); }
body.theme-light .clk-world-row__offset { color: rgba(0, 0, 0, 0.35); }
body.theme-light .clk-world-row { border-bottom-color: rgba(0, 0, 0, 0.06); }

body.theme-light .clk-alarm-row {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.04);
}

body.theme-light .clk-alarm-row__time { color: rgba(0, 0, 0, 0.85); }
body.theme-light .clk-alarm-row__label { color: rgba(0, 0, 0, 0.65); }

body.theme-light .clk-sw-display__main { color: rgba(0, 0, 0, 0.85); }
body.theme-light .clk-circle-btn--secondary {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

body.theme-light .clk-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1a1a2e;
}

body.theme-light .clk-select {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #1a1a2e;
}

/* ── Responsive ── */
@media (max-width: 400px) {
  .clk-hero__hm { font-size: 56px; }
  .clk-hero__sec { font-size: 22px; }
  .clk-sw-display__main { font-size: 42px; }
  .clk-sw-display__cs { font-size: 22px; }
  .clk-alarm-row__time { font-size: 28px; }
  .clk-circle-btn { width: 64px; height: 64px; font-size: 13px; }
  .clk-timer__ring-wrap { width: 160px; height: 160px; }
  .clk-timer__time { font-size: 32px; }
}

/* Mobile layout (separate UI) */
body.is-mobile .desktop-logo,
body.is-mobile .top-logo,
body.is-mobile .layer-mid,
body.is-mobile .layer-fore {
  display: none !important;
}

body.is-mobile .background-logo {
  display: none !important;
}

body.is-mobile .mobile-desktop {
  position: relative;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  overscroll-behavior: none;
}

body.is-mobile .mobile-frame {
  position: relative;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  padding:
    calc(env(safe-area-inset-top) + 12px) calc(env(safe-area-inset-right) + 18px) calc(env(safe-area-inset-bottom) + 14px) calc(env(safe-area-inset-left) + 18px);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

body.is-phone .mobile-frame {
  padding:
    calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 20px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 20px);
}

@supports (padding: max(0px)) {
  body.is-phone .mobile-frame {
    padding:
      calc(env(safe-area-inset-top) + 10px) max(env(safe-area-inset-right), 20px) calc(env(safe-area-inset-bottom) + 12px) max(env(safe-area-inset-left), 20px);
  }
}

body.is-mobile .mobile-frame,
body.is-mobile .mobile-shell,
body.is-mobile .mobile-hero,
body.is-mobile .mobile-search-bar,
body.is-mobile .mobile-bottom,
body.is-mobile .mobile-dock,
body.is-mobile .mobile-tray {
  max-width: 100%;
  box-sizing: border-box;
}

body.is-mobile .mobile-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  overscroll-behavior: contain;
  touch-action: pan-y;
  flex: 1;
  z-index: 1;
}

/* Base mobile icon grid - responsive layout */
body.is-mobile .mobile-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100px, 25vw), 1fr));
  gap: clamp(8px, 2vw, 16px);
  padding: 8px 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  touch-action: pan-y;
}

/* Responsive desktop icons for mobile - valid dimensions for touch targets */
body.is-mobile .mobile-icon-grid .desktop-icon,
body.is-mobile .mobile-icon-grid .desktop-shortcut {
  position: relative;
  width: 100%;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  touch-action: manipulation;
  box-sizing: border-box;
}

body.is-mobile .mobile-icon-grid .desktop-icon .shortcut-icon,
body.is-mobile .mobile-icon-grid .desktop-icon svg {
  width: clamp(40px, 12vmin, 56px);
  height: clamp(40px, 12vmin, 56px);
  object-fit: contain;
}

body.is-mobile .mobile-icon-grid .desktop-icon .shortcut-label {
  font-size: clamp(10px, 3vmin, 12px);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Multi-page container */
body.is-mobile .mobile-pages-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body.is-mobile .mobile-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100px, 25vw), 1fr));
  gap: clamp(8px, 2vw, 16px);
  padding: 8px 12px;
  box-sizing: border-box;
  align-content: start;
}

body.is-mobile.is-landscape .mobile-page {
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: clamp(12px, 3vw, 20px);
  padding: 12px 16px;
}

body.is-mobile .mobile-page-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  min-height: 20px;
}

body.is-mobile .mobile-page-indicator .page-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.is-mobile .mobile-page-indicator .page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

body.is-mobile .mobile-page-indicator .page-dot.active {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

body.is-mobile .mobile-page-indicator .page-dot:active {
  transform: scale(0.9);
}

@supports (padding: max(0px)) {
  body.is-mobile .mobile-frame {
    padding:
      calc(env(safe-area-inset-top) + 12px) max(env(safe-area-inset-right), 18px) calc(env(safe-area-inset-bottom) + 14px) max(env(safe-area-inset-left), 18px);
  }
}

@supports (padding: constant(safe-area-inset-top)) {
  body.is-mobile .mobile-frame {
    padding:
      calc(constant(safe-area-inset-top) + 12px) calc(constant(safe-area-inset-right) + 18px) calc(constant(safe-area-inset-bottom) + 14px) calc(constant(safe-area-inset-left) + 18px);
  }
}

/* (v3: removed — shell is always flex-column, no side-by-side layout) */



body.is-mobile .mobile-shell>* {
  max-width: 100%;
  min-width: 0;
}

body.is-mobile .mobile-hero {
  display: none;
}

body.is-mobile .mobile-hero.glass-bubble {
  background:
    radial-gradient(circle at 20% 20%, rgba(140, 220, 255, 0.2), transparent 50%),
    linear-gradient(135deg, rgba(10, 18, 32, 0.85), rgba(6, 10, 20, 0.92));
  border: 1px solid rgba(120, 200, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 18px 40px rgba(0, 0, 0, 0.45);
}

body.is-mobile .mobile-hero-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

body.is-mobile .mobile-hero-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

body.is-mobile .mobile-hero-status .mobile-status-temp,
body.is-mobile .mobile-hero-status .mobile-status-condition {
  text-align: right;
}

body.is-mobile .mobile-brand-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(120, 200, 255, 0.25);
}

body.is-mobile .mobile-brand-mark svg {
  width: 36px;
  height: 36px;
}

body.is-mobile .mobile-brand-copy {
  display: grid;
  gap: 4px;
}

body.is-mobile .mobile-brand-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  background: linear-gradient(135deg, #c9fbff 0%, #69e3ff 45%, #2aa9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.is-mobile .mobile-status-left,
body.is-mobile .mobile-status-right {
  display: grid;
  gap: 4px;
}

body.is-mobile .mobile-status-time {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
}


/* ── Mobile Touch Overrides ── */
/* --- GLOBAL MOBILE OVERRIDES (The Checkmate Fix) --- */
body.is-mobile,
body.is-mobile * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Allow text selection in specific inputs if needed */
body.is-mobile input,
body.is-mobile textarea,
body.is-mobile [contenteditable="true"] {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

body.is-mobile .mobile-status-date,
body.is-mobile .mobile-status-condition {
  font-size: 11px;
  opacity: 0.75;
}

body.is-mobile .mobile-status-temp {
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

body.is-mobile .mobile-search {
  display: grid;
  gap: 10px;
  padding: 0;
  border-radius: 0;
  min-width: 0;
  width: 100%;
  margin-top: 2px;
}

body.is-mobile .mobile-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border-radius: 18px;
  background: var(--glass-surface-2);
  border: 1px solid var(--border-light);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 24px rgba(0, 0, 0, 0.35);
  width: 100%;
  box-sizing: border-box;
}

body.is-mobile .mobile-search .search-input {
  width: 100%;
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  font-size: 13px;
  border-radius: 14px;
  border: 1px solid rgba(120, 200, 255, 0.18);
  background: rgba(6, 12, 22, 0.5);
  color: inherit;
}

body.is-phone .mobile-search .search-input {
  font-size: 16px;
}

body.is-mobile input,
body.is-mobile textarea,
body.is-mobile select,
body.is-mobile [contenteditable="true"] {
  font-size: 16px;
}

/* ── MobileShell Core ── */

.mobile-shell {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── App Layer & Window ── */
/* App Layer (overlay for floating windows — transparent so home shows through scrim) */
.m-app-layer {
  position: absolute;
  inset: 0;
  z-index: 1000;
  /* Must be well above dock (z:400) */
  background: transparent;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.m-app-layer[hidden] {
  display: none !important;
}

/* Base App Window */
.app-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--glass-surface-1);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  color: var(--surface-text);
}

.app-close-btn {
  position: absolute;
  top: 40px;
  /* Safe Area */
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 24px;
  color: var(--surface-text);
  z-index: 1000;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ── Snake App — Neon Serpent ── */
.app-snake {
  background: #030810;
  display: flex;
  overflow: hidden;
}

.app-snake .snake-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

/* Tablet/Desktop: Adaptive Layouts (>= 600px landscape) */
@media (min-width: 600px) and (orientation: landscape) {
  /* Browser: Wider Toolbar */
  .browser-toolbar {
    padding: 0 24px;
    gap: 16px;
  }

  .browser-url {
    font-size: 16px;
  }
}

/* --- Mobile Shell Core Z-Index & Layout Fixes --- */
.m-app-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  background: transparent;
  pointer-events: none;
  display: none;
}

.m-app-layer:where(:not([hidden])) {
  display: flex !important;
  flex-direction: column;
}

/* App Window Container Force-Fill */
.app-window {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #000;
}

/* Smart Search Z-Index Management */
.m-search-container {
  transition: opacity 0.3s ease;
  z-index: 50;
}



.app-clock[data-debug="clock-root"] .clock-alarm-days,
.app-clock[data-debug="clock-root"] .clock-alarm-next {
  font-size: 11px;
  color: rgba(220, 235, 255, 0.7);
}

.app-clock[data-debug="clock-root"] .clock-day-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.app-clock[data-debug="clock-root"] .clock-day-chip {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(230, 241, 255, 0.8);
  font-size: 12px;
  cursor: pointer;
}

.app-clock[data-debug="clock-root"] .clock-day-chip.is-active {
  background: linear-gradient(135deg, rgba(126, 246, 229, 0.95), rgba(90, 198, 255, 0.95));
  color: #0a1628;
  border-color: transparent;
}

.app-clock[data-debug="clock-root"] .clock-alarm-row {
  cursor: pointer;
}

.app-clock[data-debug="clock-root"] .clock-alarm-editor {
  margin-top: -4px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 18, 32, 0.45);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* ── Weather App V2 ── */
/* Weather app v2 (mobile shell) */
/* Weather app v2 (mobile shell) - Solid Layout Redesign */
.app-weather {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #0a1628 0%, #060e1a 100%);
  color: #e8f0ff;
  transition: background 0.8s ease;
  width: 100%;
  height: 100%;
}

.app-weather .weather-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  padding: 0;
  /* Reset padding, handled by inner elements */
  display: block;
  /* Reset display */
}

.app-weather[data-debug="weather-root"]::before,
.app-weather[data-debug="weather-root"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.app-weather[data-debug="weather-root"]::before {
  opacity: 0.95;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 233, 170, 0.5), rgba(255, 212, 128, 0.14) 28%, transparent 54%),
    radial-gradient(circle at 78% 14%, rgba(128, 202, 255, 0.18), transparent 44%),
    linear-gradient(180deg, rgba(55, 128, 185, 0.18) 0%, rgba(7, 27, 49, 0.08) 58%, rgba(5, 15, 28, 0.22) 100%);
  transition: opacity 0.7s ease, background 0.8s ease;
}

.app-weather[data-debug="weather-root"]::after {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.app-weather[data-debug="weather-root"] .weather-shell {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 12px calc(env(safe-area-inset-bottom) + 14px);
}

.app-weather .weather-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  z-index: 20;
  background: rgba(6, 14, 26, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-weather .weather-controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.app-weather .weather-actions-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.app-weather .weather-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-weather .weather-heading {
  font-family: "Avenir Next", "SF Pro Display", "Trebuchet MS", sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  text-align: center;
  white-space: nowrap;
}

.app-weather .weather-head-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-weather .weather-close-bubble {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.app-weather .weather-close-bubble:active {
  background: rgba(255, 255, 255, 0.2);
}

.app-weather .weather-search-wrap {
  position: relative;
  flex: 1;
  max-width: 240px;
}

.app-weather .weather-btn-search {
  grid-column: 1 / -1;
}

.app-weather .weather-btn-unit {
  grid-column: 1 / 2;
}

.app-weather .weather-btn-refresh {
  grid-column: 2 / 4;
}

.app-weather .weather-btn-locate {
  grid-column: 4 / 5;
}

.app-weather .weather-search-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(162, 223, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #f2fbff;
  font-size: 14px;
  padding: 11px 12px;
}

.app-weather .weather-search-input::placeholder {
  color: rgba(214, 236, 252, 0.58);
}

.app-weather .weather-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  z-index: 10;
  background: rgba(7, 19, 34, 0.97);
  border: 1px solid rgba(156, 222, 255, 0.3);
  border-radius: 12px;
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
  gap: 6px;
}

.app-weather .weather-suggestions.is-open {
  display: grid;
}

.app-weather .weather-suggestion {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e8f8ff;
  text-align: left;
  padding: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-weather .weather-suggestion-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-weather .weather-suggestion-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(150, 214, 248, 0.4);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(126, 201, 243, 0.14);
  color: rgba(214, 239, 255, 0.9);
}

.app-weather .weather-chip-btn {
  min-height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(162, 223, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #e8f8ff;
  padding: 0 12px;
  font-size: 13px;
}

.app-weather .weather-locate-btn {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.app-weather .weather-content {
  position: absolute;
  top: 52px;
  /* Below header */
  bottom: 0;
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 20px) 16px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 12px;
  z-index: 10;
}

.app-weather .weather-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.app-weather .weather-hero-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.app-weather .weather-city {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.85;
}

.app-weather .weather-temp {
  font-size: 64px;
  line-height: 1;
  font-weight: 200;
  letter-spacing: -2px;
  color: #fff;
}

.app-weather .weather-condition {
  font-size: 14px;
  opacity: 0.92;
}

.app-weather .weather-range,
.app-weather .weather-meta {
  font-size: 12px;
  opacity: 0.72;
}

.app-weather .weather-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 20px;
}

.app-weather .weather-status {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(164, 227, 252, 0.42);
  color: rgba(219, 245, 255, 0.94);
  background: rgba(145, 210, 245, 0.14);
  max-width: 56%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-weather .weather-status[data-type="warn"] {
  border-color: rgba(255, 188, 130, 0.46);
  background: rgba(255, 166, 97, 0.14);
  color: rgba(255, 219, 180, 0.95);
}

.app-weather .weather-status[data-type="ok"] {
  border-color: rgba(138, 233, 190, 0.44);
  background: rgba(114, 216, 168, 0.13);
  color: rgba(204, 255, 230, 0.96);
}

.app-weather .weather-status.is-hidden {
  display: none;
}

.app-weather .weather-hero-icon svg {
  width: 66px;
  height: 66px;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.app-weather .weather-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  display: grid;
  gap: 10px;
  min-width: 0;
  transition: background 0.45s ease, border-color 0.45s ease, transform 0.35s ease;
}

.app-weather .weather-card-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.72;
}

.app-weather .weather-hourly {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}

.app-weather .weather-hour-card {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 8px;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  scroll-snap-align: start;
  transition: background 0.15s;
}

.app-weather .weather-hour-time {
  font-size: 11px;
  opacity: 0.72;
}

.app-weather .weather-hour-icon svg {
  width: 20px;
  height: 20px;
}

.app-weather .weather-hour-temp {
  font-size: 13px;
  font-weight: 600;
}

.app-weather .weather-hour-precip {
  font-size: 10px;
  opacity: 0.68;
}

.app-weather .weather-empty-state {
  border-radius: 10px;
  border: 1px dashed rgba(176, 225, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 11px;
  font-size: 12px;
  color: rgba(213, 236, 250, 0.7);
  line-height: 1.35;
}

.app-weather .weather-daily {
  display: grid;
  gap: 7px;
}

.app-weather .weather-day-row {
  display: grid;
  grid-template-columns: minmax(58px, 0.8fr) 28px 44px minmax(92px, 1fr);
  gap: 8px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  font-size: 13px;
  transition: background 0.15s;
}

.app-weather .weather-day-icon svg {
  width: 18px;
  height: 18px;
}

.app-weather .weather-day-temp {
  text-align: right;
  font-weight: 600;
}

.app-weather .weather-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.app-weather .weather-detail-tile {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.app-weather .weather-detail-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.5;
}

.app-weather .weather-detail-value {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-weather .weather-location-list,
.app-weather .weather-alerts {
  display: grid;
  gap: 8px;
}

.app-weather .weather-location-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.app-weather .weather-location-btn {
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e7f8ff;
  padding: 9px 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.app-weather .weather-location-btn.is-active {
  border-color: rgba(136, 230, 255, 0.66);
  background: rgba(124, 223, 250, 0.2);
}

.app-weather .weather-location-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-weather .weather-location-badge {
  border-radius: 999px;
  background: rgba(124, 223, 250, 0.25);
  padding: 2px 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.app-weather .weather-location-remove {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #ffb3b3;
}

.app-weather .weather-location-empty,
.app-weather .weather-alert-empty {
  font-size: 12px;
  opacity: 0.68;
}

.app-weather .weather-air-main {
  font-size: 24px;
  font-weight: 700;
}

.app-weather .weather-air-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.app-weather .weather-air-tile {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 7px 8px;
  display: grid;
  gap: 4px;
}

.app-weather .weather-air-label {
  font-size: 10px;
  opacity: 0.7;
}

.app-weather .weather-air-value {
  font-size: 13px;
  font-weight: 600;
}

.app-weather .weather-alert-item {
  border-radius: 10px;
  border: 1px solid rgba(255, 168, 168, 0.24);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 9px;
  display: grid;
  gap: 4px;
}

.app-weather .weather-alert-title {
  font-size: 12px;
  font-weight: 600;
}

.app-weather .weather-alert-meta {
  font-size: 10px;
  opacity: 0.72;
}

.app-weather .weather-alert-desc {
  font-size: 11px;
  opacity: 0.78;
  white-space: normal;
  word-break: break-word;
}

.app-weather .weather-footer {
  display: none;
}

.app-weather .weather-content.is-loading {
  opacity: 0.85;
}

.app-weather.is-weather-shift::before {
  filter: saturate(1.12) brightness(1.03);
}

.app-weather.is-weather-shift .weather-hero-icon svg {
  transform: scale(1.06);
  opacity: 0.92;
}

.app-weather[data-weather-mood="clear"] .weather-hero-card {
  background:
    radial-gradient(circle at 85% 16%, rgba(255, 224, 125, 0.35), transparent 46%),
    linear-gradient(160deg, rgba(99, 193, 252, 0.26), rgba(11, 33, 58, 0.44));
}

.app-weather[data-weather-mood="rain"] .weather-hero-card,
.app-weather[data-weather-mood="storm"] .weather-hero-card {
  background:
    radial-gradient(circle at 85% 16%, rgba(176, 205, 255, 0.28), transparent 48%),
    linear-gradient(165deg, rgba(61, 105, 156, 0.34), rgba(8, 20, 38, 0.54));
}

.app-weather[data-weather-mood="snow"] .weather-hero-card {
  background:
    radial-gradient(circle at 82% 14%, rgba(231, 246, 255, 0.3), transparent 46%),
    linear-gradient(160deg, rgba(130, 180, 220, 0.3), rgba(15, 29, 48, 0.46));
}

.app-weather[data-weather-phase="dawn"] {
  background: linear-gradient(180deg, #3a4d7f 0%, #213b65 44%, #0d243f 100%);
}

.app-weather[data-weather-phase="dawn"]::before {
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 199, 127, 0.62), rgba(255, 168, 107, 0.2) 30%, transparent 56%),
    radial-gradient(circle at 78% 14%, rgba(141, 205, 255, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(240, 158, 122, 0.16) 0%, rgba(64, 110, 168, 0.14) 58%, rgba(9, 24, 44, 0.32) 100%);
}

.app-weather[data-weather-phase="day"] {
  background: linear-gradient(180deg, #4a86bf 0%, #2a5f95 42%, #133b64 100%);
}

.app-weather[data-weather-phase="day"]::before {
  background:
    radial-gradient(circle at 18% 15%, rgba(255, 235, 164, 0.75), rgba(255, 208, 114, 0.26) 24%, transparent 50%),
    radial-gradient(circle at 80% 12%, rgba(189, 234, 255, 0.26), transparent 46%),
    linear-gradient(180deg, rgba(130, 207, 255, 0.2) 0%, rgba(24, 88, 143, 0.12) 52%, rgba(9, 35, 63, 0.26) 100%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="sunset"] {
  background: linear-gradient(180deg, #5f4a74 0%, #473c6b 42%, #1a274a 100%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="sunset"]::before {
  background:
    radial-gradient(circle at 78% 28%, rgba(255, 178, 109, 0.68), rgba(255, 127, 90, 0.24) 30%, transparent 54%),
    radial-gradient(circle at 22% 18%, rgba(255, 147, 160, 0.24), transparent 50%),
    linear-gradient(180deg, rgba(255, 151, 110, 0.18) 0%, rgba(105, 92, 164, 0.18) 56%, rgba(10, 24, 47, 0.34) 100%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"] {
  background: linear-gradient(180deg, #08152a 0%, #0a1a35 38%, #030b17 100%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"]::before {
  background:
    radial-gradient(circle at 82% 16%, rgba(228, 240, 255, 0.22), rgba(160, 194, 248, 0.08) 14%, transparent 38%),
    radial-gradient(circle at 74% 14%, rgba(122, 165, 232, 0.24) 1px, transparent 2px),
    radial-gradient(circle at 58% 22%, rgba(141, 175, 240, 0.18) 1px, transparent 2px),
    radial-gradient(circle at 24% 18%, rgba(116, 152, 226, 0.16) 1px, transparent 2px),
    linear-gradient(180deg, rgba(12, 30, 58, 0.12) 0%, rgba(5, 12, 25, 0.34) 56%, rgba(1, 5, 11, 0.58) 100%);
}

.app-weather[data-debug="weather-root"][data-weather-mood="clear"]::after {
  opacity: 0.18;
  background:
    radial-gradient(circle at 68% 22%, rgba(255, 255, 255, 0.32), transparent 48%),
    radial-gradient(circle at 36% 68%, rgba(145, 214, 255, 0.18), transparent 52%);
}

.app-weather[data-debug="weather-root"][data-weather-mood="cloud"]::after {
  opacity: 0.34;
  background:
    radial-gradient(circle at 20% 26%, rgba(246, 252, 255, 0.24), transparent 46%),
    radial-gradient(circle at 58% 30%, rgba(236, 248, 255, 0.2), transparent 42%),
    radial-gradient(circle at 88% 34%, rgba(224, 241, 255, 0.16), transparent 36%);
  animation: weather-app-cloud-drift 18s linear infinite;
}

.app-weather[data-debug="weather-root"][data-weather-mood="fog"]::after {
  opacity: 0.3;
  background:
    linear-gradient(180deg, rgba(230, 242, 255, 0.22), transparent 44%),
    linear-gradient(0deg, rgba(210, 230, 246, 0.18), transparent 60%);
  filter: blur(8px);
}

.app-weather[data-debug="weather-root"][data-weather-mood="rain"]::after {
  opacity: 0.34;
  background-image:
    linear-gradient(120deg, rgba(150, 212, 255, 0.26) 0%, rgba(150, 212, 255, 0) 40%),
    repeating-linear-gradient(120deg, rgba(185, 229, 255, 0.55) 0px, rgba(185, 229, 255, 0.55) 2px, rgba(185, 229, 255, 0) 8px, rgba(185, 229, 255, 0) 14px);
  background-size: 180% 180%, 100% 100%;
  animation: weather-app-rain-fall 2s linear infinite;
}

.app-weather[data-debug="weather-root"][data-weather-mood="snow"]::after {
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(circle, rgba(232, 248, 255, 0.84) 0%, rgba(232, 248, 255, 0) 58%),
    radial-gradient(circle, rgba(214, 240, 255, 0.78) 0%, rgba(214, 240, 255, 0) 58%);
  background-size: 20px 20px, 15px 15px, 12px 12px;
  background-position: 0 -12px, 16px -26px, 32px -8px;
  animation: weather-app-snow-fall 6s linear infinite;
}

.app-weather[data-debug="weather-root"][data-weather-mood="storm"]::after {
  opacity: 0.44;
  background-image:
    linear-gradient(120deg, rgba(196, 221, 255, 0.34) 0%, rgba(196, 221, 255, 0) 42%),
    repeating-linear-gradient(120deg, rgba(212, 233, 255, 0.66) 0px, rgba(212, 233, 255, 0.66) 2px, rgba(212, 233, 255, 0) 6px, rgba(212, 233, 255, 0) 11px);
  background-size: 180% 180%, 100% 100%;
  animation: weather-app-rain-fall 1.25s linear infinite, weather-app-storm-flicker 4.5s steps(1) infinite;
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"][data-weather-mood="clear"]::after {
  opacity: 0.1;
  background:
    radial-gradient(circle at 74% 16%, rgba(206, 226, 255, 0.24), transparent 42%),
    radial-gradient(circle at 30% 70%, rgba(96, 148, 222, 0.12), transparent 52%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"][data-weather-mood="cloud"]::after {
  opacity: 0.18;
  background:
    radial-gradient(circle at 20% 26%, rgba(186, 212, 245, 0.2), transparent 46%),
    radial-gradient(circle at 58% 30%, rgba(162, 198, 236, 0.15), transparent 42%),
    radial-gradient(circle at 88% 34%, rgba(150, 186, 226, 0.12), transparent 36%);
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"][data-weather-mood="rain"]::after {
  opacity: 0.26;
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"][data-weather-mood="snow"]::after {
  opacity: 0.3;
}

.app-weather[data-debug="weather-root"][data-weather-phase="night"][data-weather-mood="storm"]::after {
  opacity: 0.32;
}

@keyframes weather-app-rain-fall {
  0% {
    background-position: 0 0, 0 0;
  }

  100% {
    background-position: 0 100%, 0 100%;
  }
}

@keyframes weather-app-snow-fall {
  0% {
    background-position: 0 -12px, 16px -26px, 32px -8px;
  }

  100% {
    background-position: 0 110px, 16px 124px, 32px 96px;
  }
}

@keyframes weather-app-cloud-drift {
  0% {
    transform: translateX(-2%);
  }

  100% {
    transform: translateX(2%);
  }
}

@keyframes weather-app-storm-flicker {

  0%,
  92%,
  100% {
    filter: brightness(1);
  }

  93% {
    filter: brightness(1.16);
  }

  95% {
    filter: brightness(0.95);
  }

  97% {
    filter: brightness(1.2);
  }
}

@media (max-width: 960px) {
  .app-weather[data-debug="weather-root"] .weather-head-right {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 52px;
  }
}

@media (min-width: 760px) and (orientation: landscape) {
  .app-weather[data-debug="weather-root"] .weather-content {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
    align-items: start;
  }

  .app-weather[data-debug="weather-root"] .weather-head-right {
    grid-template-columns: minmax(320px, 1fr) 96px 120px 52px;
  }
}

@media (min-width: 760px) and (orientation: portrait) {
  .app-weather[data-debug="weather-root"] .weather-shell {
    padding-inline: 16px;
  }
}

@media (min-width: 900px) {
  .app-weather[data-debug="weather-root"] .weather-content {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  }

  .app-weather[data-debug="weather-root"] .weather-head-right {
    grid-template-columns: minmax(260px, 1fr) 92px 108px 52px;
  }

  .app-weather[data-debug="weather-root"] .weather-btn-search,
  .app-weather[data-debug="weather-root"] .weather-btn-unit,
  .app-weather[data-debug="weather-root"] .weather-btn-refresh,
  .app-weather[data-debug="weather-root"] .weather-btn-locate {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .app-weather[data-debug="weather-root"] .weather-shell {
    padding: 10px;
    gap: 8px;
  }

  .app-weather[data-debug="weather-root"] .weather-temp {
    font-size: 46px;
  }

  .app-weather[data-debug="weather-root"] .weather-detail-grid {
    grid-template-columns: 1fr;
  }

  .app-weather[data-debug="weather-root"] .weather-status {
    max-width: 52%;
    font-size: 9px;
  }
}

@media (orientation: landscape) and (max-width: 899px) and (min-width: 700px) {
  .app-weather[data-debug="weather-root"] .weather-content {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}


/* ── Calculator App ── all styles moved to css/calculator.css (Tape redesign) ── */


/* ── Notes App — Aurora v2 (Browser + Floating Editor Windows) ── */

.app-notes {
  display: flex !important;
  flex-direction: column !important;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  color: var(--text-bright, #c8d6e5);
  background:
    radial-gradient(130% 120% at -5% -10%, rgba(var(--accent-rgb), 0.12), transparent 46%),
    radial-gradient(120% 130% at 120% 5%, rgba(var(--accent-rgb), 0.07), transparent 52%),
    linear-gradient(165deg, #0a1420 0%, #070e18 100%);
}

.app-notes * { box-sizing: border-box; }

/* ════════════════════════════════════════════════
   BROWSER VIEW
   ════════════════════════════════════════════════ */

.app-notes .notes-browser {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

/* ── Toolbar ── */
.app-notes .notes-bw-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.08);
  background: rgba(6, 11, 20, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.app-notes .notes-bw-search {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--text-bright);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.app-notes .notes-bw-search:focus {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.08);
}

.app-notes .notes-bw-search::placeholder {
  color: rgba(var(--accent-rgb), 0.3);
}

.app-notes .notes-bw-btn {
  height: 34px;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.app-notes .notes-bw-btn:hover {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text-bright);
}

/* ── View Toggle ── */
.app-notes .notes-bw-view-group {
  display: flex;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.app-notes .notes-bw-view-btn {
  width: 34px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.app-notes .notes-bw-view-btn + .notes-bw-view-btn {
  border-left: 1px solid rgba(var(--accent-rgb), 0.08);
}

.app-notes .notes-bw-view-btn.is-active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

/* ── + New Button ── */
.app-notes .notes-bw-new-btn {
  height: 34px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.app-notes .notes-bw-new-btn:hover {
  background: rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.12);
}

.app-notes .notes-bw-new-btn:active { transform: scale(0.95); }

/* ── Document Grid ── */
.app-notes .notes-bw-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ── List Mode ── */
.app-notes .notes-bw-grid--list {
  grid-template-columns: 1fr;
  gap: 4px;
}

.app-notes .notes-bw-grid--list .notes-doc-card {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
}

.app-notes .notes-bw-grid--list .notes-doc-hex {
  width: 34px;
  height: 34px;
  font-size: 15px;
}

.app-notes .notes-bw-grid--list .notes-doc-preview { display: none; }

.app-notes .notes-bw-grid--list .notes-doc-title {
  flex: 0 0 auto;
  max-width: 200px;
}

.app-notes .notes-bw-grid--list .notes-doc-meta {
  flex: 1;
  text-align: right;
}

/* ── Document Card ── */
.app-notes .notes-doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  padding: 12px 6px 10px;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  animation: notes-card-in 260ms cubic-bezier(0.25, 0.9, 0.25, 1) both;
}

@keyframes notes-card-in {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.app-notes .notes-doc-card:hover {
  background: rgba(var(--accent-rgb), 0.06);
  border-color: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.app-notes .notes-doc-card:hover .notes-doc-hex {
  transform: scale(1.06);
}

.app-notes .notes-doc-card:active { transform: scale(0.96); }

.app-notes .notes-doc-card.is-pinned {
  border-color: rgba(var(--accent-rgb), 0.18);
}

/* ── Hex Document Icon ── */
.app-notes .notes-doc-hex {
  width: 54px;
  height: 54px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(150deg, rgba(232, 220, 200, 0.28), rgba(232, 220, 200, 0.08));
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.16s;
}

.app-notes .notes-doc-card.is-pinned .notes-doc-hex {
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.32), rgba(var(--accent-rgb), 0.12));
}

/* ── Card Preview (inside hex, hidden overflow) ── */
.app-notes .notes-doc-preview {
  position: absolute;
  inset: 0;
  padding: 10px 6px;
  font-size: 5px;
  line-height: 1.3;
  color: rgba(var(--ui-text-rgb), 0.3);
  overflow: hidden;
  pointer-events: none;
  text-align: left;
  word-break: break-all;
}

.app-notes .notes-doc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}

.app-notes .notes-doc-meta {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Pin Badge ── */
.app-notes .notes-doc-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 5px;
  padding: 2px 6px;
}

/* ── Browser Empty State ── */
.app-notes .notes-bw-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}

.app-notes .notes-bw-empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  opacity: 0.7;
}

.app-notes .notes-bw-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 300px;
}

.app-notes .notes-bw-empty-btn {
  margin-top: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 10px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--accent-contrast, #0a0f1a);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}

.app-notes .notes-bw-empty-btn:hover {
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.25);
}

.app-notes .notes-bw-empty-btn:active { transform: scale(0.96); }

/* ── Browser Status Bar ── */
.app-notes .notes-bw-status {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-dim);
  padding: 6px 14px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.05);
  background: rgba(6, 11, 20, 0.92);
}

/* ════════════════════════════════════════════════
   EDITOR (floating WindowChrome)
   ════════════════════════════════════════════════ */

.notes-editor-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  color: var(--text-bright);
}

/* ── Menu Bar ── */
.notes-menubar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 4px;
  background: rgba(6, 11, 20, 0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
}

.notes-menu-wrapper {
  position: relative;
}

.notes-menu-trigger {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-bright);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.12s;
}

.notes-menu-trigger:hover,
.notes-menu-trigger.is-open {
  background: rgba(var(--accent-rgb), 0.12);
}

.notes-menu-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 220px;
  padding: 4px 0;
  background: rgba(8, 15, 28, 0.96);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  z-index: 50;
}

.notes-menu-dropdown[hidden] { display: none; }

.notes-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--text-bright);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.notes-menu-item:hover {
  background: rgba(var(--accent-rgb), 0.12);
}

.notes-menu-item--danger { color: var(--danger); }
.notes-menu-item--danger:hover { background: rgba(255, 71, 87, 0.1); }

.notes-menu-sep {
  height: 1px;
  margin: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
}

.notes-menu-shortcut {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 28px;
  font-family: var(--font-sans);
}

/* ── Save Indicator (in menu bar) ── */
.notes-menubar .notes-ed-save-ind {
  margin-left: auto;
  padding-right: 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.6;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.notes-menubar .notes-ed-save-ind.is-saving {
  opacity: 1;
  color: var(--warning, #ffa502);
}

/* ── Find Bar ── */
.notes-editor-root .notes-ed-find-bar[hidden] { display: none; }

.notes-editor-root .notes-ed-find-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(var(--accent-rgb), 0.04);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.06);
}

.notes-editor-root .notes-ed-find-input {
  width: 140px;
  height: 28px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--text-bright);
  font-size: 12px;
  padding: 0 8px;
  outline: none;
}

.notes-editor-root .notes-ed-find-input:focus {
  border-color: rgba(var(--accent-rgb), 0.3);
}

.notes-editor-root .notes-ed-find-input::placeholder { color: var(--text-dim); }

.notes-editor-root .notes-ed-find-info {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 60px;
}

.notes-editor-root .notes-ed-find-actions {
  display: flex;
  gap: 3px;
  margin-left: auto;
}

.notes-editor-root .notes-ed-find-btn {
  height: 26px;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.04);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.notes-editor-root .notes-ed-find-btn:hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text-bright);
}

/* ── Body Textarea ── */
.notes-editor-root .notes-ed-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: none;
  padding: 20px 24px;
  background: rgba(8, 15, 28, 0.98);
  color: var(--text-bright);
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  line-height: 1.7;
  tab-size: 4;
  resize: none;
  outline: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.notes-editor-root .notes-ed-body::placeholder { color: var(--text-dim); }

/* ── Editor Status Bar ── */
.notes-editor-root .notes-ed-status {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-dim);
  border-top: 1px solid rgba(var(--accent-rgb), 0.05);
  background: rgba(6, 11, 20, 0.92);
  padding: 5px 14px;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.02em;
}

/* ════════════════════════════════════════════════
   CONTEXT MENU
   ════════════════════════════════════════════════ */

.app-notes .notes-ctx-menu {
  position: absolute;
  z-index: 100;
  min-width: 150px;
  padding: 4px;
  border: 1px solid rgba(var(--accent-rgb), 0.12);
  border-radius: 10px;
  background: rgba(8, 15, 28, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.app-notes .notes-ctx-item {
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.app-notes .notes-ctx-item:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

.app-notes .notes-ctx-item.is-active {
  color: var(--accent);
}

.app-notes .notes-ctx-item--danger:hover {
  background: rgba(255, 71, 87, 0.12);
  color: var(--danger);
}

/* ════════════════════════════════════════════════
   MOBILE (< 768px)
   ════════════════════════════════════════════════ */

@media (max-width: 767px) {
  .app-notes .notes-bw-toolbar {
    flex-wrap: wrap;
  }

  .app-notes .notes-bw-search {
    flex: 1 0 100%;
    order: 2;
  }

  .app-notes .notes-bw-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    padding: 10px;
    gap: 8px;
  }

  .notes-editor-root .notes-ed-body {
    padding: 14px 16px;
    font-size: 15px;
  }

  .notes-editor-root .notes-ed-find-bar {
    flex-wrap: wrap;
    gap: 4px;
  }

  .notes-editor-root .notes-ed-find-input {
    flex: 1;
    min-width: 100px;
    width: auto;
  }

  .notes-menubar {
    flex-wrap: wrap;
    height: auto;
    padding: 2px 4px;
  }
}

/* ════════════════════════════════════════════════
   LIGHT MODE
   ════════════════════════════════════════════════ */

body.theme-light .app-notes {
  background:
    radial-gradient(130% 120% at -5% -10%, rgba(var(--accent-rgb), 0.06), transparent 46%),
    radial-gradient(120% 130% at 120% 5%, rgba(var(--accent-rgb), 0.04), transparent 52%),
    linear-gradient(165deg, #f8f9fa 0%, #f0f1f3 100%);
}

body.theme-light .app-notes .notes-bw-toolbar {
  background: rgba(245, 245, 247, 0.88);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .app-notes .notes-bw-search {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .app-notes .notes-bw-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .app-notes .notes-bw-new-btn {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.2);
}

body.theme-light .app-notes .notes-doc-card {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .app-notes .notes-doc-card:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(var(--accent-rgb), 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.theme-light .app-notes .notes-doc-hex {
  background: linear-gradient(150deg, rgba(180, 160, 130, 0.25), rgba(180, 160, 130, 0.08));
}

body.theme-light .app-notes .notes-doc-card.is-pinned .notes-doc-hex {
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.25), rgba(var(--accent-rgb), 0.08));
}

body.theme-light .app-notes .notes-bw-status {
  background: rgba(245, 245, 247, 0.95);
  border-top-color: rgba(0, 0, 0, 0.05);
}

body.theme-light .app-notes .notes-ctx-menu {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.theme-light .app-notes .notes-ctx-item:hover {
  background: rgba(var(--accent-rgb), 0.06);
}

body.theme-light .app-notes .notes-doc-pin {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.12);
}

body.theme-light .app-notes .notes-bw-view-btn {
  background: rgba(0, 0, 0, 0.02);
}

body.theme-light .app-notes .notes-bw-view-btn.is-active {
  background: rgba(var(--accent-rgb), 0.1);
}

/* ── Light mode: Editor floating windows ── */
body.theme-light .notes-menubar {
  background: rgba(245, 245, 247, 0.85);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .notes-menu-trigger:hover,
body.theme-light .notes-menu-trigger.is-open {
  background: rgba(var(--accent-rgb), 0.08);
}

body.theme-light .notes-menu-dropdown {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

body.theme-light .notes-menu-item:hover {
  background: rgba(var(--accent-rgb), 0.06);
}

body.theme-light .notes-menu-sep {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .notes-editor-root .notes-ed-body {
  background: rgba(255, 255, 255, 0.98);
}

body.theme-light .notes-editor-root .notes-ed-find-bar {
  background: rgba(var(--accent-rgb), 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

body.theme-light .notes-editor-root .notes-ed-find-input {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .notes-editor-root .notes-ed-find-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .notes-editor-root .notes-ed-status {
  background: rgba(245, 245, 247, 0.95);
  border-top-color: rgba(0, 0, 0, 0.05);
}


/* ── Files App ── */
/* Files App v1.0 (authoritative, mobile-first) */
/* ── Files App — Aurora v2 ── */

.app-files-v5 {
  color: var(--text, #e8f0fc);
  background:
    radial-gradient(130% 120% at -5% -10%, rgba(var(--accent-rgb), 0.14), transparent 46%),
    radial-gradient(120% 130% at 120% 5%, rgba(var(--accent-rgb), 0.08), transparent 52%),
    linear-gradient(165deg, #0a1420 0%, #070e18 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.app-files-v5 * { box-sizing: border-box; }

/* ── Toolbar ── */
.app-files-v5 .yf-toolbar {
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  background: rgba(6, 11, 20, 0.88);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.app-files-v5 .yf-toolbar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* ── Nav Buttons ── */
.app-files-v5 .yf-nav-group {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.app-files-v5 .yf-nav-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #e8f0fc);
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.12s;
}

.app-files-v5 .yf-nav-btn:disabled { opacity: 0.3; }
.app-files-v5 .yf-nav-btn:active:not(:disabled) {
  transform: scale(0.9);
  background: rgba(var(--accent-rgb), 0.12);
}

/* ── Path Area (Breadcrumb + Input) ── */
.app-files-v5 .yf-path-area {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.app-files-v5 .yf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.03);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  cursor: text;
}

.app-files-v5 .yf-breadcrumb::-webkit-scrollbar { display: none; }

.app-files-v5 .yf-breadcrumb-seg {
  border: 0;
  background: transparent;
  color: rgba(var(--accent-rgb), 0.6);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.app-files-v5 .yf-breadcrumb-seg:not(:disabled):hover {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  cursor: pointer;
}

.app-files-v5 .yf-breadcrumb-seg:disabled {
  color: var(--text, #e8f0fc);
  font-weight: 600;
  opacity: 1;
  cursor: default;
}

.app-files-v5 .yf-breadcrumb-sep {
  color: rgba(var(--accent-rgb), 0.25);
  font-size: 10px;
  flex-shrink: 0;
  pointer-events: none;
}

.app-files-v5 .yf-path-input {
  width: 100%;
  height: 32px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
}

.app-files-v5 .yf-path-input:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

/* ── Search ── */
.app-files-v5 .yf-search-wrap {
  display: none;
  flex: 1;
  min-width: 0;
  gap: 4px;
  align-items: center;
}

.app-files-v5.is-searching .yf-search-wrap { display: flex; }
.app-files-v5.is-searching .yf-path-area { display: none; }

.app-files-v5 .yf-search-input {
  flex: 1;
  height: 32px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--text);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
}

.app-files-v5 .yf-search-input:focus {
  border-color: rgba(var(--accent-rgb), 0.4);
}

.app-files-v5 .yf-search-input::placeholder {
  color: rgba(var(--accent-rgb), 0.3);
}

/* ── Buttons ── */
.app-files-v5 .yf-btn {
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  min-height: 32px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text, #e8f0fc);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.app-files-v5 .yf-btn:disabled { opacity: 0.3; }
.app-files-v5 .yf-btn:active:not(:disabled) { transform: scale(0.96); }

.app-files-v5 .yf-btn.is-active {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

/* ── View Toggle ── */
.app-files-v5 .yf-view-group {
  display: flex;
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.app-files-v5 .yf-view-btn {
  border: 0;
  width: 32px;
  height: 30px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}

.app-files-v5 .yf-view-btn + .yf-view-btn {
  border-left: 1px solid rgba(var(--accent-rgb), 0.08);
}

.app-files-v5 .yf-view-btn.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--accent);
}

/* ── Body ── */
.app-files-v5 .yf-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

/* ── Sidebar ── */
.app-files-v5 .yf-sidebar {
  display: none;
  border-right: 1px solid rgba(var(--accent-rgb), 0.08);
  background: rgba(6, 11, 20, 0.5);
  padding: 8px 6px;
  overflow-y: auto;
}

.app-files-v5 .yf-sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.4);
  padding: 12px 10px 4px;
}

.app-files-v5 .yf-sidebar-item {
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0 10px 10px 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  min-height: 38px;
  padding: 0 10px;
  margin: 1px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.app-files-v5 .yf-sidebar-item.is-active {
  border-left-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
}

.app-files-v5 .yf-sidebar-item.is-drop-target {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
}

@media (hover: hover) {
  .app-files-v5 .yf-sidebar-item:hover:not(.is-active) {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.8);
  }
}

/* ── Main ── */
.app-files-v5 .yf-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Grid ── */
.app-files-v5 .yf-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.app-files-v5.is-dragging .yf-grid { touch-action: none; }

/* ── Card (Grid Mode) ── */
.app-files-v5 .yf-card {
  border: 1px solid rgba(var(--accent-rgb), 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  animation: yf-tile-in 260ms cubic-bezier(0.25, 0.9, 0.25, 1) both;
  animation-delay: calc(var(--yf-index, 0) * 18ms);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.2s;
}

.app-files-v5 .yf-card-main {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 6px 10px;
  min-height: 108px;
  width: 100%;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  text-align: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: relative;
  z-index: 1;
}

/* ── Hex Icon ── */
.app-files-v5 .yf-card-icon {
  width: 52px;
  height: 52px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: grid;
  place-items: center;
  font-size: 22px;
  transition: transform 0.16s;
}

/* Image thumbnail inside hexagon */
.app-files-v5 .yf-card-icon-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* No gradient when showing a real thumbnail */
.app-files-v5 .yf-card-icon:has(.yf-card-icon-thumb) {
  background: none;
}

/* Type gradient fills */
.app-files-v5 .yf-card-icon[data-type="folder"] {
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.32), rgba(var(--accent-rgb), 0.12));
}
.app-files-v5 .yf-card-icon[data-type="text"] {
  background: linear-gradient(150deg, rgba(232, 220, 200, 0.25), rgba(232, 220, 200, 0.08));
}
.app-files-v5 .yf-card-icon[data-type="image"] {
  background: linear-gradient(150deg, rgba(179, 136, 255, 0.28), rgba(179, 136, 255, 0.1));
}
.app-files-v5 .yf-card-icon[data-type="code"] {
  background: linear-gradient(150deg, rgba(100, 181, 246, 0.28), rgba(100, 181, 246, 0.1));
}
.app-files-v5 .yf-card-icon[data-type="archive"] {
  background: linear-gradient(150deg, rgba(255, 202, 40, 0.28), rgba(255, 202, 40, 0.1));
}
.app-files-v5 .yf-card-icon[data-type="media"] {
  background: linear-gradient(150deg, rgba(255, 138, 128, 0.28), rgba(255, 138, 128, 0.1));
}
.app-files-v5 .yf-card-icon[data-type="pdf"] {
  background: linear-gradient(150deg, rgba(211, 47, 47, 0.28), rgba(211, 47, 47, 0.1));
}
.app-files-v5 .yf-card-icon[data-type="unknown"] {
  background: linear-gradient(150deg, rgba(160, 170, 190, 0.2), rgba(160, 170, 190, 0.06));
}

.app-files-v5 .yf-card-name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-files-v5 .yf-card-sub {
  width: 100%;
  font-size: 10px;
  color: rgba(var(--accent-rgb), 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta (visible in list mode only) */
.app-files-v5 .yf-card-meta { display: none; }

.app-files-v5 .yf-card-date,
.app-files-v5 .yf-card-size {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

/* ── Card States ── */
.app-files-v5 .yf-card.is-cut-source { opacity: 0.45; filter: saturate(0.6); }
.app-files-v5 .yf-card.is-dragging-source { opacity: 0.3; filter: saturate(0.5); }

.app-files-v5 .yf-card.is-drop-target {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15) inset;
}

.app-files-v5 .yf-card.is-drop-before::before,
.app-files-v5 .yf-card.is-drop-after::before {
  content: '';
  position: absolute;
  left: 8px; right: 8px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
  z-index: 3;
}

.app-files-v5 .yf-card.is-drop-before::before { top: 4px; }
.app-files-v5 .yf-card.is-drop-after::before { bottom: 4px; }

.app-files-v5 .yf-card.is-drop-into {
  transform: scale(1.03);
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18) inset, 0 8px 20px rgba(var(--accent-rgb), 0.1);
}

.app-files-v5 .yf-card.is-pressed {
  border-color: rgba(var(--accent-rgb), 0.3);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1) inset;
}

.app-files-v5 .yf-card.is-pressed .yf-card-icon { transform: scale(1.08); }

.app-files-v5 .yf-card.is-context-armed {
  border-color: rgba(var(--accent-rgb), 0.4);
  animation: yf-jiggle 150ms ease-in-out infinite;
}

@media (hover: hover) and (pointer: fine) {
  .app-files-v5 .yf-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-rgb), 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

.app-files-v5 .yf-card-main:active { transform: scale(0.97); }

/* ── List Mode ── */
.app-files-v5 .yf-grid--list {
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 6px 8px;
}

.app-files-v5 .yf-grid--list .yf-card {
  border-radius: 10px;
  animation-delay: calc(var(--yf-index, 0) * 8ms);
}

.app-files-v5 .yf-grid--list .yf-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  min-height: 44px;
  padding: 6px 10px;
}

.app-files-v5 .yf-grid--list .yf-card-icon {
  width: 32px;
  height: 32px;
  font-size: 15px;
  flex-shrink: 0;
}

.app-files-v5 .yf-grid--list .yf-card-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.app-files-v5 .yf-grid--list .yf-card-sub { display: none; }

.app-files-v5 .yf-grid--list .yf-card-meta {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

/* ── Empty State ── */
.app-files-v5 .yf-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(var(--accent-rgb), 0.18);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.02);
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
}

.app-files-v5 .yf-empty-hint {
  margin: 0;
  font-size: 11px;
  color: rgba(var(--accent-rgb), 0.35);
}

/* ── Status Bar ── */
.app-files-v5 .yf-status {
  flex: 0 0 auto;
  min-height: 28px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.08);
  background: rgba(6, 11, 20, 0.7);
  color: rgba(var(--accent-rgb), 0.45);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 10px max(4px, calc(env(safe-area-inset-bottom, 0px) + 4px));
  cursor: pointer;
  transition: color 0.15s;
}

.app-files-v5 .yf-status:hover { color: rgba(var(--accent-rgb), 0.7); }

/* ── Context Menu ── */
.app-files-v5 .yf-menu {
  position: fixed;
  min-width: 200px;
  max-width: min(280px, calc(100vw - 16px));
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.96);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  padding: 5px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 140ms ease, transform 140ms ease;
  z-index: 400;
}

.app-files-v5 .yf-menu.is-visible {
  opacity: 1;
  transform: scale(1);
}

.app-files-v5 .yf-menu-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  text-align: left;
  padding: 0 10px;
  background: transparent;
  color: var(--text, #e8f0fc);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s;
}

.app-files-v5 .yf-menu-item:active { background: rgba(var(--accent-rgb), 0.12); }
.app-files-v5 .yf-menu-item.is-danger { color: #ff8a8a; }
.app-files-v5 .yf-menu-item.is-checked { color: var(--accent); }

.app-files-v5 .yf-menu-sep {
  height: 1px;
  margin: 3px 6px;
  background: rgba(var(--accent-rgb), 0.1);
}

/* ── Drag Ghost ── */
.app-files-v5.is-dragging .yf-card-main { cursor: grabbing; }

.app-files-v5 .yf-drag-ghost {
  position: fixed;
  top: 0; left: 0;
  z-index: 99999;
  pointer-events: none;
  margin: 0;
  transform: translate3d(0, 0, 0);
  opacity: 0.92;
  will-change: transform;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.4));
  animation: none;
  transition: none;
}

.app-files-v5 .yf-drag-ghost .yf-card-main {
  pointer-events: none !important;
  touch-action: none !important;
  transform: none !important;
}

.app-files-v5 .yf-drag-ghost .yf-card-icon { transform: scale(1.06); }

.app-files-v5 .yf-grid.is-drop-target {
  outline: none;
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.04);
}

/* ── Animations ── */
@keyframes yf-tile-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes yf-jiggle {
  0%, 100% { transform: rotate(-0.8deg); }
  50% { transform: rotate(0.8deg); }
}

@media (prefers-reduced-motion: reduce) {
  .app-files-v5 .yf-card,
  .app-files-v5 .yf-card-main,
  .app-files-v5 .yf-card-icon,
  .app-files-v5 .yf-btn,
  .app-files-v5 .yf-nav-btn {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 760px) {
  .app-files-v5 .yf-toolbar-row { flex-wrap: wrap; }
  .app-files-v5 .yf-toolbar-row > .yf-nav-group + .yf-path-area {
    order: 3; flex-basis: 100%; margin-top: 2px;
  }
  .app-files-v5 .yf-toolbar-row > .yf-nav-group ~ .yf-search-wrap {
    order: 3; flex-basis: 100%; margin-top: 2px;
  }
}

@media (min-width: 960px) {
  .app-files-v5 .yf-body { grid-template-columns: 200px minmax(0, 1fr); }
  .app-files-v5 .yf-sidebar { display: block; }
  .app-files-v5 .yf-grid:not(.yf-grid--list) {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    padding: 14px;
  }
}

@media (orientation: landscape) and (max-width: 959px) {
  .app-files-v5 .yf-grid:not(.yf-grid--list) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ── Light Mode ── */
body.theme-light .app-files-v5 {
  color: var(--text, #1a1a2e);
  background:
    radial-gradient(130% 120% at -5% -10%, rgba(var(--accent-rgb), 0.06), transparent 46%),
    linear-gradient(165deg, #f5f7fa 0%, #edf0f5 100%);
}

body.theme-light .app-files-v5 .yf-toolbar {
  background: rgba(245, 247, 250, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .app-files-v5 .yf-nav-btn,
body.theme-light .app-files-v5 .yf-btn {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}

body.theme-light .app-files-v5 .yf-breadcrumb {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(0, 0, 0, 0.02);
}

body.theme-light .app-files-v5 .yf-breadcrumb-seg {
  color: rgba(var(--accent-rgb), 0.65);
}

body.theme-light .app-files-v5 .yf-breadcrumb-seg:disabled {
  color: var(--text);
}

body.theme-light .app-files-v5 .yf-sidebar {
  background: rgba(240, 242, 245, 0.6);
  border-right-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .app-files-v5 .yf-sidebar-item {
  color: rgba(0, 0, 0, 0.55);
}

body.theme-light .app-files-v5 .yf-sidebar-item.is-active {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

body.theme-light .app-files-v5 .yf-card {
  border-color: rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.6);
}

body.theme-light .app-files-v5 .yf-card-sub { color: rgba(0, 0, 0, 0.4); }

body.theme-light .app-files-v5 .yf-card-date,
body.theme-light .app-files-v5 .yf-card-size { color: rgba(0, 0, 0, 0.35); }

body.theme-light .app-files-v5 .yf-status {
  background: rgba(240, 242, 245, 0.8);
  border-top-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.4);
}

body.theme-light .app-files-v5 .yf-menu {
  background: rgba(250, 250, 252, 0.96);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

body.theme-light .app-files-v5 .yf-menu-item { color: var(--text); }
body.theme-light .app-files-v5 .yf-menu-item:active { background: rgba(var(--accent-rgb), 0.08); }
body.theme-light .app-files-v5 .yf-menu-sep { background: rgba(0, 0, 0, 0.06); }

body.theme-light .app-files-v5 .yf-empty {
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.5);
}

body.theme-light .app-files-v5 .yf-search-input,
body.theme-light .app-files-v5 .yf-path-input {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
}

body.theme-light .app-files-v5 .yf-view-group {
  border-color: rgba(0, 0, 0, 0.08);
}

body.theme-light .app-files-v5 .yf-view-btn {
  color: rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.02);
}

body.theme-light .app-files-v5 .yf-view-btn.is-active {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
}

body.theme-light .app-files-v5 .yf-sidebar-label {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .app-files-v5 .yf-empty-hint {
  color: rgba(0, 0, 0, 0.35);
}

body.theme-light .app-files-v5 .yf-card.is-drop-target {
  border-color: rgba(var(--accent-rgb), 0.5);
}

body.theme-light .app-files-v5 .yf-card.is-drop-into {
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15) inset, 0 8px 20px rgba(var(--accent-rgb), 0.08);
}

body.theme-light .app-files-v5 .yf-drag-ghost {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.15));
}



/* ── Calendar App ── */
/* Smart Icon Base */
/* =========================================
   iOS-style Folder Icon Preview (Mobile)
   ========================================= */

.y-folder-icon {
  border-radius: 22%;
  overflow: hidden;
}

.y-folder-content {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.y-folder-preview {
  width: 80%;
  height: 80%;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8%;
  padding: 10%;
  border-radius: 18%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.y-folder-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.28),
      rgba(255, 255, 255, 0.06) 40%,
      rgba(0, 0, 0, 0.10) 100%);
  pointer-events: none;
  mix-blend-mode: overlay;
  opacity: 0.55;
}

body.is-mobile .m-app-item:active .y-folder-preview {
  filter: saturate(1.05) brightness(1.05);
}

.folder-mini {
  border-radius: 28%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.folder-mini {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.folder-mini-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.folder-mini-emoji {
  font-size: 16px;
  line-height: 1;
}

/* Press feedback similar to iOS */
body.is-mobile .m-app-item:active .y-folder-icon {
  transform: scale(0.94);
}

/* Calendar Smart Icon Specifics */
.app-icon-calendar {
  background: #fff;
  border-radius: 22%;
  /* Match iOS/Mac style */
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* =========================================
   INLINED CALENDAR APP STYLES
   ========================================= */
/* Calendar App */
.app-calendar {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  color: var(--text-primary);
  height: 100%;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--glass-border);
}

.calendar-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.calendar-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cal-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.today-btn {
  font-size: 13px;
  font-weight: 500;
}

.calendar-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Month View */
.view-month {
  flex: 2;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.cal-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 12px;
  text-align: center;
}

.cal-days-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 8px;
  flex: 1;
}

.cal-day {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 80px;
}

.cal-day:hover {
  background: rgba(255, 255, 255, 0.08);
}

.cal-day.empty {
  background: transparent;
  pointer-events: none;
}

.cal-day.is-today {
  background: rgba(62, 200, 255, 0.15);
  border-color: var(--glow-blue);
  box-shadow: 0 0 15px rgba(62, 200, 255, 0.2);
}

.cal-day.is-selected {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.day-num {
  font-size: 16px;
  font-weight: 500;
}

.day-dot {
  width: 6px;
  height: 6px;
  background-color: var(--glow-teal);
  border-radius: 50%;
  margin-top: 6px;
  box-shadow: 0 0 5px var(--glow-teal);
}

/* Details Panel */
.calendar-details {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border-left: 1px solid var(--glass-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-header {
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.details-day-name {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
}

.details-date-num {
  font-size: 48px;
  font-weight: 700;
  margin: 8px 0;
  background: linear-gradient(135deg, #fff 0%, #a5f3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.details-month {
  font-size: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.details-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.no-events {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 20px;
}

.event-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 12px;
}

.event-time {
  font-size: 12px;
  color: var(--glow-blue);
  font-weight: 600;
}

.event-title {
  font-size: 14px;
  font-weight: 500;
}

.event-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  opacity: 0.6;
}

.event-delete:hover {
  opacity: 1;
  color: #ff6b6b;
}

.add-event-btn {
  background: linear-gradient(135deg, var(--glow-blue) 0%, #2aa9ff 100%);
  border: none;
  color: #000;
  font-weight: 600;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-event-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 200, 255, 0.4);
}


/* ── Folder Icon Previews ── */
.folder-bubbly {
  cursor: pointer;
}

.folder-glass3d .folder-bubbly-content {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
}

/* The main glass container for the mini-icon grid */
.folder-preview-grid {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 18px;
  position: relative;
  z-index: 1;
  /* Frosted glass effect matching iOS folder look */
  background:
    radial-gradient(120% 120% at var(--fx, 50%) var(--fy, 35%),
      rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 50%, rgba(0, 0, 0, 0.04) 100%),
    linear-gradient(180deg, rgba(200, 210, 225, 0.35) 0%, rgba(140, 150, 170, 0.25) 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
}

/* 2×2 grid layout (iOS-style) */
.folder-preview-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  padding: 8px;
  place-items: center;
}

/* 3×3 fallback (for many items) */
.folder-preview-3x3 {
  display: grid;

  /* Refined 2x2 folder previews */
  .folder-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 4px;
    width: 82%;
    height: 82%;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: box-shadow 0.2s;
    z-index: 1;
  }
}

.folder-preview-cell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

/* Favicons in folder previews need to fill the cell — Google's favicon
   API returns square PNGs that already have their own internal padding,
   so a tight 85% inside ANOTHER 5%-padded box made them look dwarfed.
   `cover` instead of `contain` crops the rare oversized favicon down to
   square while still letting normal favicons sit edge-to-edge. */
.folder-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.folder-preview-emoji {
  font-size: 14px;
  line-height: 1;
  text-align: center;
}

.folder-preview-placeholder {
  width: 14px;
  height: 14px;
  opacity: 0.35;
}

/* --- Folder Overlay (v1.0 Premium) --- */
.folder-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: hidden;
}

.folder-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.folder-overlay-container {
  width: 90%;
  max-width: 320px;
  min-height: 320px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 36px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 0 0.5px rgba(255, 255, 255, 0.2),
    inset 0 0 20px rgba(255, 255, 255, 0.05);
  transform: scale(0.85);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.folder-overlay.is-visible .folder-overlay-container {
  transform: scale(1);
}

.folder-overlay-header {
  width: 100%;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.folder-title-input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  text-align: center;
  width: 100%;
  outline: none;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}

.folder-title-input:focus {
  background: rgba(255, 255, 255, 0.1);
}

.folder-overlay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  justify-items: center;
}

.folder-item-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  transition: transform 0.2s;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

/* Ensure wrapper captures all events */
.folder-item-wrapper * {
  pointer-events: none !important;
}

/* Search Bar Clearance - Managed by JS Layout Engine now */
body.is-mobile .mobile-shell {
  /* padding-top removed to let JS handle positioning */
}

@media (orientation: landscape) {
  body.is-mobile .mobile-shell {
    /* padding-top removed */
  }
}

.folder-item-wrapper:active {
  transform: scale(0.92);
}

.folder-item-label {
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

/* Glass depth layers */
.folder-depth {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.20), 0 4px 8px rgba(0, 0, 0, 0.10);
}

/* (v3: removed — grid is in-flow, not absolute) */

.folder-specular {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(80% 60% at var(--fx, 50%) var(--fy, 35%),
      rgba(255, 255, 255, 0.35), transparent 55%);
  mix-blend-mode: overlay;
  opacity: 0.9;
}

.folder-sheen {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 3;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 25% 15%, rgba(255, 255, 255, 0.15), transparent 35%);
}

/* Rim light edge highlight */
.folder-rim {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  z-index: 4;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.folder-glass3d:active {
  transform: scale(0.96);
}

/* Hover state for 3D lift */
.folder-glass3d:hover .folder-preview-grid {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}



/* =========================

/* ── Folder Creation Visuals ── */
/* --- Folder Creation Visuals --- */
.app-icon.is-folder-target .app-icon-inner {
  transform: scale(1.08);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-icon.is-folder-dwell-triggered .app-icon-inner {
  animation: folder-pulse-active 0.8s infinite ease-in-out;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

@keyframes folder-pulse-active {
  0% {
    transform: scale(1.08);
  }

  50% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1.12);
  }
}
}

/* ── App Layer Transitions ── */
/* --- App Layer Transitions (Session 3A) --- */
.m-app-layer {
  display: none;
}

.m-app-layer.active {
  display: block !important;
}
/* --- Layout Stabilization v1.0.0 --- */
:root {
  --yancotab-status-bar-height: 44px;
  --yancotab-search-top: 54px;
  --yancotab-search-height: 50px;
  --yancotab-search-width: min(92vw, 620px);
}

/* (v3: removed — status bar styled in shell.css, top-right only) */

/* (v3: removed — search bar in flow, styled in shell.css) */

/* (v3: removed — grid uses flex layout, not CSS vars) */

body.is-mobile .m-app-layer {
  z-index: 2000 !important;
}

body.is-mobile .mobile-dock.m-dock,
body.is-mobile .m-dock.mobile-dock,
body.is-mobile .m-dock {
  transition:
    left 220ms ease,
    right 220ms ease,
    bottom 220ms ease,
    padding 220ms ease,
    gap 220ms ease,
    border-radius 220ms ease,
    opacity 220ms ease,
    transform 220ms ease !important;
}

body.in-app .status-bar {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  pointer-events: none !important;
}

body.in-app #smart-search-bar.m-search-container,
body.in-app .m-search-container,
body.in-app .m-search-input {
  opacity: 0 !important;
  pointer-events: none !important;
}

body.is-mobile.is-orientation-transition .app-icon,
body.is-mobile.is-orientation-transition .m-grid-pages {
  transition-duration: 220ms !important;
}

/* (v3: removed — search responsive handled in shell.css) */

/* ── Mobile Grid & Dock Positioning ── */
/* Status Bar Background */
.m-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: rgba(10, 20, 35, 0.7);
  backdrop-filter: blur(20px);
  z-index: 40;
}

/* (v3: removed — grid positioning handled by shell.css) */

/* (v3: removed — m-grid-pages styled in shell.css) */

/* Items are absolutely positioned inside m-grid-pages */
body.is-mobile .app-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

body.is-mobile .m-app-item.is-dragging-source {
  opacity: 0;
  /* Hidden but takes up space */
}

/* Jiggle Animation */
@keyframes jiggle {
  0% {
    transform: rotate(-1deg);
  }

  50% {
    transform: rotate(1deg);
  }

  100% {
    transform: rotate(-1deg);
  }
}

body.is-mobile .m-app-item.is-jovial {
  animation: jiggle 0.3s infinite ease-in-out;
  z-index: 10;
}

body.is-mobile .m-app-item.is-jovial::before {
  content: "✖";
  position: absolute;
  top: -6px;
  left: -6px;
  width: 20px;
  height: 20px;
  background: rgba(200, 200, 200, 0.8);
  color: #333;
  border-radius: 50%;
  font-size: 12px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.is-mobile .m-app-icon {
  width: 58px;

/* 2. Dock */
.m-dock {
  margin: 0 16px 16px;
  height: 84px;
  background: rgba(20, 30, 48, 0.5);
  backdrop-filter: blur(25px);
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
  z-index: 100;
}

.m-dock-item {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.m-dock-item:active {
  transform: scale(0.9);
}

.m-dock-item .m-icon {
  font-size: 26px;
}
