    /* ===== Themeable dashboard-shell holdouts (defaults = Original "Deep Space") =====
       Each theme file (assets/css/themes/*.css) overrides these via :root[data-theme]. */
    :root{
      --app-canvas:#070c1a;
      --app-atmos:
        radial-gradient(ellipse 70% 55% at 50% 38%, rgba(60,120,210,.35) 0%, rgba(50,100,185,.18) 35%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 15% 8%, rgba(65,130,210,.22) 0%, transparent 60%),
        radial-gradient(ellipse 45% 35% at 82% 78%, rgba(55,115,200,.16) 0%, transparent 55%),
        radial-gradient(ellipse 90% 2% at 50% 0%, rgba(91,156,245,.14) 0%, transparent 100%),
        radial-gradient(ellipse 100% 100% at 50% 50%, transparent 55%, rgba(8,14,30,.3) 100%),
        linear-gradient(175deg, #1a2d50 0%, #152545 40%, #112040 100%);
      --app-atmos-noise-opacity:.025;
      --app-accent-rgb:91 156 245;
      --app-neutral-rgb:8 13 26;
      --app-header-bg:rgba(8,13,26,.82);
      --app-header-blur:20px;
      --app-header-border:rgba(91,156,245,.1);
      --app-tile-bg:linear-gradient(145deg, rgba(17,27,46,.95) 0%, rgba(13,20,35,.98) 100%);
      --app-tile-radius:14px;
      --app-tile-border:rgba(91,156,245,.28);
      --app-tile-shadow:0 2px 8px rgba(0,0,0,.3), 0 0 4px rgba(91,156,245,.06), inset 0 1px 0 rgba(255,255,255,.04);
      --app-menu-bg:linear-gradient(180deg, #101829 0%, #080d1a 100%);
      --app-modal-bg:linear-gradient(160deg, #101829 0%, #0a1020 100%);
      --app-cta-bg:linear-gradient(135deg, #5b9cf5 0%, #2563eb 100%);
      --app-cta-text:#fff;
      --app-mic-bg:#ef4444;
      --app-launcher-border:rgba(91,156,245,.32);
      --app-glass-blur:0px;
      --app-overlay-input-bg:rgba(10,15,30,.45);
    }

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

    html {
      height: 100%;
      height: 100dvh;
      overflow: hidden;
      overscroll-behavior: none;
    }

    body {
      background: var(--app-canvas);
      color: var(--app-text-primary, #e8edf5);
      font-family: var(--app-font-body, 'DM Sans', sans-serif);
      overflow: hidden;
      height: 100%;
      height: 100dvh;
      position: fixed;
      inset: 0;
      overscroll-behavior: none;
      -webkit-overflow-scrolling: auto;
    }

    /* Atmospheric background — inspired by background.png */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background: var(--app-atmos);
      pointer-events: none;
      z-index: 0;
    }

    /* Subtle noise texture overlay */
    body::after {
      content: '';
      position: fixed;
      inset: 0;
      opacity: var(--app-atmos-noise-opacity);
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
      background-repeat: repeat;
      background-size: 256px 256px;
      pointer-events: none;
      z-index: 0;
    }

    body > *, body > header, body > nav, body > div {
      position: relative;
      z-index: 1;
    }

    body.dragging-widget {
      touch-action: none;
      overflow: hidden;
      user-select: none;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
    }

    body.dragging-widget * {
      user-select: none !important;
      -webkit-user-select: none !important;
      -moz-user-select: none !important;
      -ms-user-select: none !important;
    }

    /* Hide screen indicators while dragging so trash zone stays visible */
    body.dragging-widget .screen-indicators {
      display: none;
    }

    /* Header */
    header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1000;
      background: var(--app-header-bg);
      backdrop-filter: blur(var(--app-header-blur)) saturate(1.4);
      -webkit-backdrop-filter: blur(var(--app-header-blur)) saturate(1.4);
      padding: 15px 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid var(--app-header-border);
      height: 70px;
    }

    header .hamburger {
      position: absolute;
      right: 20px;
    }

    .back-to-questionnaire {
      position: absolute;
      left: 8px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 10px;
      background: rgb(255 255 255 / .08);
      color: #fff;
      font-size: 14px;
      font-weight: 600;
      text-decoration: none;
      white-space: nowrap;
      transition: background 0.25s ease;
    }

    .back-to-questionnaire:hover {
      background: rgb(255 255 255 / .16);
    }

    .back-to-questionnaire i {
      font-size: 14px;
    }

    /* Collapse to icon-only so the label never crowds the centered logo */
    @media (max-width: 600px) {
      .back-to-questionnaire span { display: none; }
      .back-to-questionnaire { padding: 10px; gap: 0; }
    }

    header img {
      height: 40px;
    }

    .hamburger {
      cursor: pointer;
      padding: 10px;
      border-radius: 10px;
      transition: background 0.25s ease;
    }

    .hamburger:hover {
      background: rgb(var(--app-accent-rgb) / .08);
    }

    .hamburger i {
      color: var(--app-accent-primary, #5b9cf5);
      font-size: 22px;
    }

    /* Screens Container */
    #screens-container {
      display: flex;
      overflow-x: auto;
      overflow-y: hidden;
      scroll-snap-type: x mandatory;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
      height: 100%;
      height: 100dvh;
      padding-top: 8px;
      scrollbar-width: none;
      overscroll-behavior-y: none;
      touch-action: pan-x;
    }

    #screens-container::-webkit-scrollbar {
      display: none;
    }

    #screens-container.no-scroll {
      overflow-x: hidden;
    }

    .screen {
      min-width: 100vw;
      max-width: 100vw;
      scroll-snap-align: start;
      padding: 2px 15px 0 15px;
      position: relative;
      height: calc(100dvh - 8px);
      height: calc(100vh - 8px);
      overflow: hidden;
    }

    /* Widget Grid */
    .widget-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(5, 1fr);
      gap: 24px 10px;
      height: calc(100dvh - 8px - 4px - 90px);
      height: calc(100vh - 8px - 4px - 90px);
      position: relative;
      padding-top: 26px;
    }

    /* Grid Overlay */
    .grid-overlay {
      position: absolute;
      top: 26px;
      left: 0;
      right: 0;
      bottom: 0;
      display: none;
      grid-template-columns: repeat(4, 1fr);
      grid-template-rows: repeat(5, 1fr);
      gap: 24px 10px;
      pointer-events: none;
      z-index: 500;
    }

    .grid-overlay.active {
      display: grid;
    }

    .grid-cell {
      border: 2px dashed rgba(91, 156, 245, 0.2);
      border-radius: 16px;
      background: rgba(91, 156, 245, 0.03);
      transition: all 0.2s ease;
    }

    .grid-cell.highlight {
      background: rgba(91, 156, 245, 0.12);
      border-color: var(--app-accent-primary, #5b9cf5);
      box-shadow: inset 0 0 20px rgba(91, 156, 245, 0.08);
    }

    .grid-cell.occupied {
      background: rgba(239, 68, 68, 0.12);
      border-color: var(--app-accent-danger, #ef4444);
    }

    /* Widget Placeholder */
    .widget-placeholder {
      position: absolute;
      border: 2px dashed var(--app-accent-primary, #5b9cf5);
      border-radius: 18px;
      background: rgba(91, 156, 245, 0.1);
      display: none;
      pointer-events: none;
      z-index: 499;
      transition: all 0.1s ease;
    }

    .widget-placeholder.active {
      display: block;
    }

    .widget-placeholder.invalid {
      border-color: var(--app-accent-danger, #ef4444);
      background: rgba(239, 68, 68, 0.1);
    }

    /* Widget Styles */
    .widget {
      background: var(--app-tile-bg);
      border-radius: var(--app-tile-radius);
      border: 1px solid var(--app-tile-border);
      box-shadow: var(--app-tile-shadow);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 3px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;
      user-select: none;
      -webkit-user-select: none;
      touch-action: none;
      -ms-touch-action: none;
      -webkit-tap-highlight-color: transparent;
      box-sizing: border-box;
    }

    /* Disabled widget overlay */
    .widget.disabled {
      cursor: pointer;
    }

    body.show-disabled-overlay .widget.disabled::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgb(var(--app-neutral-rgb) / .55);
      border-radius: 15px;
      z-index: 5;
      pointer-events: none;
    }

    body.show-disabled-overlay .widget.disabled img {
      filter: grayscale(70%);
    }

    body.show-disabled-overlay .widget.disabled .widget-label {
      filter: grayscale(70%);
      opacity: 0.7;
    }

    .widget:hover {
      transform: translateY(-2px);
      border-color: rgba(91, 156, 245, 0.3);
      box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(59, 125, 216, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    .widget.dragging {
      opacity: 0.85;
      transform: scale(1.04) rotate(1.5deg);
      z-index: 2000;
      position: fixed;
      pointer-events: none;
      border-color: rgba(91, 156, 245, 0.4);
      box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(59, 125, 216, 0.2);
    }

    .widget.placeholder-source {
      opacity: 0.3;
    }

    .widget img {
      max-width: 100%;
      max-height: 100%;
      width: 100%;
      height: 100%;
      object-fit: contain;
      pointer-events: none;
      -webkit-user-drag: none;
      user-drag: none;
    }

    .widget-label {
      display: none;
      font-size: 11px;
      color: var(--app-accent-primary, #5b9cf5);
      text-align: center;
      margin-top: 5px;
      font-weight: 500;
      pointer-events: none;
      letter-spacing: 0.2px;
    }

    /* Widget Size Classes - positioned widgets */
    .widget[data-grid-position][data-size="1x1"] {
      grid-column: var(--col-start) / span 1;
      grid-row: var(--row-start) / span 1;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="2x1"] {
      grid-column: var(--col-start) / span 2;
      grid-row: var(--row-start) / span 1;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="1x2"] {
      grid-column: var(--col-start) / span 1;
      grid-row: var(--row-start) / span 2;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="2x2"] {
      grid-column: var(--col-start) / span 2;
      grid-row: var(--row-start) / span 2;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="4x2"] {
      grid-column: var(--col-start) / span 4;
      grid-row: var(--row-start) / span 2;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="2x3"] {
      grid-column: var(--col-start) / span 2;
      grid-row: var(--row-start) / span 3;
      width: 100%;
      height: 100%;
    }

    .widget[data-grid-position][data-size="4x4"] {
      grid-column: var(--col-start) / span 4;
      grid-row: var(--row-start) / span 4;
      width: 100%;
      height: 100%;
    }

    /* Widget Size Classes - unpositioned widgets (fallback) */
    .widget[data-size="1x1"]:not([data-grid-position]) {
      grid-column: span 1;
      grid-row: span 1;
    }

    .widget[data-size="2x1"]:not([data-grid-position]) {
      grid-column: span 2;
      grid-row: span 1;
    }

    .widget[data-size="1x2"]:not([data-grid-position]) {
      grid-column: span 1;
      grid-row: span 2;
    }

    .widget[data-size="2x2"]:not([data-grid-position]) {
      grid-column: span 2;
      grid-row: span 2;
    }

    .widget[data-size="4x2"]:not([data-grid-position]) {
      grid-column: span 4;
      grid-row: span 2;
    }

    .widget[data-size="2x3"]:not([data-grid-position]) {
      grid-column: span 2;
      grid-row: span 3;
    }

    .widget[data-size="4x4"]:not([data-grid-position]) {
      grid-column: span 4;
      grid-row: span 4;
    }

    /* Plus Screen */
    .plus-screen {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .plus-icon {
      width: 120px;
      height: 120px;
      border-radius: 28px;
      background: rgba(91, 156, 245, 0.06);
      border: 2px dashed rgba(91, 156, 245, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .plus-icon:hover {
      background: rgba(91, 156, 245, 0.12);
      border-color: rgba(91, 156, 245, 0.4);
      transform: scale(1.06);
      box-shadow: 0 0 30px rgba(59, 125, 216, 0.15);
    }

    .plus-icon svg {
      width: 56px;
      height: 56px;
    }

    .plus-icon svg rect {
      fill: rgba(91, 156, 245, 0.5);
    }

    .plus-icon:hover svg rect {
      fill: rgba(91, 156, 245, 0.8);
    }

    /* Screen Indicators */
    .screen-indicators {
      position: fixed;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 8px;
      z-index: 100;
      padding: 5px 12px;
      background: rgba(8, 13, 26, 0.6);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-radius: 20px;
      border: 1px solid rgba(91, 156, 245, 0.08);
    }

    .screen-indicator {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(139, 152, 176, 0.25);
      transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      cursor: pointer;
    }

    .screen-indicator.active {
      background: var(--app-accent-primary, #5b9cf5);
      width: 24px;
      border-radius: 4px;
      box-shadow: 0 0 8px rgba(91, 156, 245, 0.4);
    }

    /* Modal Styles */
    .modal {
      display: none;
      position: fixed;
      z-index: 2000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(4, 6, 14, 0.88);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      animation: fadeIn 0.25s ease;
    }

    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    .modal-content {
      background: var(--app-modal-bg);
      margin: 5% auto;
      padding: 0;
      border: 1px solid rgba(91, 156, 245, 0.15);
      border-radius: 20px;
      width: 90%;
      max-width: 500px;
      max-height: 80vh;
      overflow: hidden;
      animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 1px rgba(91, 156, 245, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }

    @keyframes slideUp {
      from {
        transform: translateY(30px);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 1;
      }
    }

    .modal-header {
      padding: 20px 24px;
      border-bottom: 1px solid rgba(91, 156, 245, 0.1);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .modal-header h3 {
      color: var(--app-text-primary, #e8edf5);
      margin: 0;
      font-weight: 600;
      font-size: 17px;
      letter-spacing: -0.2px;
    }

    .close-modal {
      color: var(--app-text-muted, #4a5568);
      font-size: 28px;
      font-weight: 300;
      cursor: pointer;
      line-height: 1;
      transition: color 0.25s ease;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 10px;
    }

    .close-modal:hover {
      color: var(--app-text-primary, #e8edf5);
      background: rgba(91, 156, 245, 0.08);
    }

    .modal-body {
      padding: 16px 20px;
      max-height: calc(80vh - 100px);
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior: contain;
      touch-action: pan-y;
    }

    /* Custom scrollbar for modal */
    .modal-body::-webkit-scrollbar {
      width: 4px;
    }
    .modal-body::-webkit-scrollbar-track {
      background: transparent;
    }
    .modal-body::-webkit-scrollbar-thumb {
      background: rgba(91, 156, 245, 0.15);
      border-radius: 4px;
    }
    .modal-body::-webkit-scrollbar-thumb:hover {
      background: rgba(91, 156, 245, 0.3);
    }

    /* Widget Category */
    .widget-category {
      margin-bottom: 10px;
      border: 1px solid rgba(91, 156, 245, 0.08);
      border-radius: 12px;
      overflow: hidden;
      transition: border-color 0.25s ease;
    }

    .widget-category:hover {
      border-color: rgba(91, 156, 245, 0.15);
    }

    .category-header {
      background: rgba(17, 27, 46, 0.6);
      padding: 14px 16px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: background 0.25s ease;
    }

    .category-header:hover {
      background: rgba(22, 32, 56, 0.8);
    }

    .category-header h4 {
      margin: 0;
      color: var(--app-text-primary, #e8edf5);
      font-size: 14px;
      font-weight: 500;
      letter-spacing: 0.1px;
    }

    .category-arrow {
      transition: transform 0.3s ease;
      color: var(--app-text-muted, #4a5568);
      font-size: 11px;
    }

    .category-header.collapsed .category-arrow {
      transform: rotate(-90deg);
    }

    .category-widgets {
      padding: 8px;
      background: rgba(8, 13, 26, 0.5);
      display: none;
    }

    .category-widgets.expanded {
      display: block;
    }

    .widget-item {
      position: relative;
      padding: 12px 14px;
      margin: 4px 0;
      background: rgba(17, 27, 46, 0.5);
      border-radius: 10px;
      cursor: grab;
      transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      align-items: center;
      gap: 12px;
      border: 1px solid transparent;
      user-select: none;
      -webkit-user-select: none;
      touch-action: pan-y;
      -ms-touch-action: pan-y;
      -webkit-tap-highlight-color: transparent;
    }

    .widget-item.dragging-active {
      touch-action: none;
      -ms-touch-action: none;
    }

    .widget-item:active {
      cursor: grabbing;
    }

    .widget-item:hover {
      background: rgba(22, 32, 56, 0.8);
      border-color: rgba(91, 156, 245, 0.15);
      transform: translateX(4px);
    }

    .widget-item.long-press-active {
      position: relative;
      border-color: rgba(91, 156, 245, 0.35) !important;
      background: rgba(30, 74, 138, 0.15);
    }

    .widget-item.long-press-active::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--app-accent-primary, #5b9cf5), var(--app-accent-secondary, #2563eb));
      border-radius: 0 0 10px 10px;
      animation: progressBar 0.3s linear forwards;
    }

    @keyframes progressBar {
      from { width: 0%; }
      to { width: 100%; }
    }

    .widget-item-icon {
      font-size: 20px;
    }

    .widget-item-name {
      color: var(--app-text-primary, #e8edf5);
      font-size: 13px;
      font-weight: 500;
      pointer-events: none;
    }

    .widget-item-hint {
      color: var(--app-text-muted, #4a5568);
      font-size: 11px;
      margin-top: 2px;
      pointer-events: none;
    }

    /* Floating Add Button */
    .floating-add-btn {
      position: fixed;
      bottom: 38px;
      right: 20px;
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: rgba(91, 156, 245, 0.1);
      border: 1px solid rgba(91, 156, 245, 0.2);
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
      z-index: 950;
      display: flex;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }

    .floating-add-btn:hover {
      background: rgba(91, 156, 245, 0.18);
      border-color: rgba(91, 156, 245, 0.35);
      transform: scale(1.06);
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(59, 125, 216, 0.15);
    }

    .floating-add-btn:active {
      transform: scale(0.95);
    }

    .floating-add-btn::before,
    .floating-add-btn::after {
      content: '';
      position: absolute;
      background: rgba(91, 156, 245, 0.6);
      border-radius: 1.5px;
    }

    .floating-add-btn::before {
      width: 20px;
      height: 2.5px;
    }

    .floating-add-btn::after {
      width: 2.5px;
      height: 20px;
    }

    /* Trash Zone */
    .trash-zone {
      position: fixed;
      bottom: 38px;
      height: 48px;
      left: 50%;
      transform: translateX(-50%);
      width: 45vw;
      max-width: 280px;
      display: none;
      align-items: center;
      justify-content: center;
      border: 2px dashed rgba(139, 152, 176, 0.35);
      border-radius: 14px;
      background: rgba(8, 13, 26, 0.7);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      pointer-events: none;
      z-index: 940;
      transition: all 0.3s ease;
    }

    .trash-zone.visible {
      display: flex;
    }

    .trash-zone.active {
      background: rgba(239, 68, 68, 0.15);
      border-color: var(--app-accent-danger, #ef4444);
      box-shadow: 0 0 24px rgba(239, 68, 68, 0.15);
    }

    .trash-zone.active .trash-icon {
      transform: scale(1.12);
      color: var(--app-accent-danger, #ef4444);
    }

    .trash-icon {
      font-size: 24px;
      color: rgba(139, 152, 176, 0.6);
      transition: all 0.3s ease;
    }

    .trash-zone.active .trash-icon {
      opacity: 1;
    }

    /* Hide grid cells in blocked areas */
    .grid-cell.blocked {
      display: none;
    }

    /* Row Labels */
    .row-labels {
      position: absolute;
      left: 0;
      right: 0;
      top: 26px;
      height: calc(100% - 26px);
      pointer-events: none;
    }

    .row-label-item {
      position: absolute;
      left: 0;
      right: 0;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding-left: 12px;
      pointer-events: auto;
      height: 24px;
    }

    .row-label-item[data-row-index="0"] {
      top: -24px;
    }

    .row-label-item[data-row-index="1"] {
      top: calc((100% - (4 * 24px)) / 5 * 1 + 24px * 1 - 24px);
    }

    .row-label-item[data-row-index="2"] {
      top: calc((100% - (4 * 24px)) / 5 * 2 + 24px * 2 - 24px);
    }

    .row-label-item[data-row-index="3"] {
      top: calc((100% - (4 * 24px)) / 5 * 3 + 24px * 3 - 24px);
    }

    .row-label-plus {
      width: 20px;
      height: 20px;
      border-radius: 5px;
      background: rgba(91, 156, 245, 0.1);
      border: 1px solid rgba(91, 156, 245, 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.25s ease;
      font-size: 16px;
      color: rgba(91, 156, 245, 0.5);
      font-weight: 400;
      user-select: none;
      opacity: 0;
      pointer-events: none;
    }

    .row-label-plus.visible {
      opacity: 1;
      pointer-events: auto;
    }

    .row-label-plus.visible:hover {
      background: rgba(91, 156, 245, 0.18);
      border-color: rgba(91, 156, 245, 0.3);
      color: var(--app-accent-primary, #5b9cf5);
      transform: scale(1.08);
    }

    .row-label-text {
      color: var(--app-text-secondary, #8b98b0);
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
      cursor: pointer;
      transition: color 0.25s ease;
      padding: 2px 8px;
      letter-spacing: 0.3px;
    }

    .row-label-text:hover {
      color: var(--app-accent-primary, #5b9cf5);
    }

    .row-label-input {
      width: 200px;
      height: 28px;
      background: rgba(12, 18, 32, 0.9);
      border: 1px solid rgba(91, 156, 245, 0.3);
      border-radius: 8px;
      color: var(--app-text-primary, #e8edf5);
      padding: 5px 10px;
      font-size: 12px;
      font-family: var(--app-font-body, 'DM Sans', sans-serif);
      outline: none;
      text-align: center;
      transition: border-color 0.25s ease;
    }

    .row-label-input:focus {
      border-color: var(--app-accent-primary, #5b9cf5);
      box-shadow: 0 0 12px rgba(91, 156, 245, 0.15);
    }

    /* Hamburger Menu */
    #navbarNav {
      position: fixed;
      top: 0;
      right: -100%;
      width: 280px;
      height: 100vh;
      background: var(--app-menu-bg);
      transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 1500;
      border-left: 1px solid rgba(91, 156, 245, 0.1);
      padding-top: 70px;
      box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
    }

    #navbarNav.show {
      right: 0;
    }

    #navbarNav ul {
      list-style: none;
      padding: 8px;
    }

    #navbarNav li {
      border-bottom: none;
    }

    #navbarNav a {
      display: block;
      padding: 14px 20px;
      color: var(--app-text-secondary, #8b98b0);
      text-decoration: none;
      transition: all 0.25s ease;
      border-radius: 10px;
      margin: 2px 0;
      font-size: 14px;
      font-weight: 500;
    }

    #navbarNav a:hover {
      background: rgba(91, 156, 245, 0.08);
      color: var(--app-text-primary, #e8edf5);
      padding-left: 28px;
    }

    #navbarNav a.disabled {
      opacity: 0.35;
      cursor: not-allowed;
    }

    .menu-overlay {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(4, 6, 14, 0.7);
      backdrop-filter: blur(4px);
      -webkit-backdrop-filter: blur(4px);
      z-index: 1400;
    }

    .menu-overlay.show {
      display: block;
    }

    /* Delete Button on Widget */
    .widget-delete-btn {
      position: absolute;
      top: 5px;
      right: 5px;
      width: 22px;
      height: 22px;
      background: var(--app-accent-danger, #ef4444);
      border-radius: 50%;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10;
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
      color: white;
      font-weight: bold;
      font-size: 16px;
      line-height: 1;
    }

    .widget.edit-mode .widget-delete-btn {
      display: flex;
    }

    /* "Opens externally" marker — external (new-tab) widgets, top-right corner.
       Used on dashboard tiles and explorer rows. Decorative only:
       pointer-events:none so it never steals the tile click or drag-press. */
    .ext-badge {
      position: absolute;
      top: 6px;
      right: 6px;
      z-index: 5;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 6px;
      background: rgba(10, 16, 32, 0.55);
      border: 1px solid rgba(255, 255, 255, 0.16);
      color: #cfe0ff;
      font-size: 10px;
      line-height: 1;
      pointer-events: none;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
      -webkit-backdrop-filter: blur(4px);
      backdrop-filter: blur(4px);
    }

    /* Edit mode: yield the corner to the red delete button. */
    .widget.edit-mode .ext-badge { display: none; }

    /* Explorer rows sit tighter; nudge the badge in slightly. */
    .widget-item .ext-badge {
      top: 8px;
      right: 8px;
      width: 18px;
      height: 18px;
      font-size: 9px;
    }

    .widget.edit-mode {
      animation: wiggle 0.35s ease infinite;
    }

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

    /* Video Widget Specific */
    .widget-video video {
      width: 100%;
      height: auto;
      border-radius: 10px;
    }

    .video-controls {
      display: flex;
      gap: 4px;
      margin-top: 8px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .video-controls button {
      padding: 5px 10px;
      background: rgba(91, 156, 245, 0.15);
      color: var(--app-text-primary, #e8edf5);
      border: 1px solid rgba(91, 156, 245, 0.2);
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .video-controls button:hover {
      background: rgba(91, 156, 245, 0.25);
    }

    .video-controls button.active {
      background: var(--app-accent-primary, #5b9cf5);
      color: #fff;
      border-color: var(--app-accent-primary, #5b9cf5);
    }

    /* ===== DESKTOP LAYOUT (>= 1024px) ===== */

    /* Navigation Arrows */
    .nav-arrow {
      display: none;
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      z-index: 1100;
      background: rgba(8, 13, 26, 0.7);
      border: 1px solid rgba(91, 156, 245, 0.15);
      border-radius: 14px;
      width: 48px;
      height: 48px;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      color: var(--app-accent-primary, #5b9cf5);
      font-size: 28px;
      line-height: 1;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      user-select: none;
      padding-bottom: 2px;
    }

    .nav-arrow:hover {
      background: rgba(91, 156, 245, 0.1);
      border-color: rgba(91, 156, 245, 0.3);
      box-shadow: 0 0 20px rgba(59, 125, 216, 0.15);
    }

    .nav-arrow.hidden {
      visibility: hidden;
      pointer-events: none;
    }

    #nav-arrow-left {
      left: 12px;
    }

    #nav-arrow-right {
      right: 12px;
    }

    @media (min-width: 1024px) {
      #screens-container {
        margin: 0 70px;
      }

      .screen {
        min-width: 50%;
        max-width: 50%;
      }

      .nav-arrow {
        display: flex;
      }

      /* Move indicators below the floating add button on desktop */
      .screen-indicators {
        bottom: 8px;
        z-index: 950;
      }
    }

    /* Small screens (iPhone SE, smaller iPhones) */
    @media (max-height: 760px) {
      .widget-grid {
        height: calc(100dvh - 8px - 4px - 64px);
        height: calc(100vh - 8px - 4px - 64px);
        gap: 18px 10px;
        padding-top: 20px;
      }

      .grid-overlay {
        gap: 18px 10px;
        top: 20px;
      }

      .row-labels {
        top: 20px;
        height: calc(100% - 20px);
      }

      .floating-add-btn {
        bottom: 12px;
        width: 40px;
        height: 40px;
        border-radius: 11px;
      }

      .floating-add-btn::before {
        width: 16px;
        height: 2px;
      }

      .floating-add-btn::after {
        width: 2px;
        height: 16px;
      }

      .trash-zone {
        bottom: 12px;
        height: 40px;
      }

      .trash-icon {
        font-size: 20px;
      }

      .screen-indicators {
        bottom: 3px;
        padding: 3px 8px;
      }

      .screen-indicator {
        width: 6px;
        height: 6px;
      }

      .screen-indicator.active {
        width: 18px;
      }
    }
/* ===== second inline block (originally <style> #2) ===== */
    #setupOverlay {
      position: fixed;
      inset: 0;
      z-index: 3000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 20px;
      background: radial-gradient(120% 120% at 50% 0%, rgba(30, 74, 138, 0.35) 0%, rgba(7, 12, 26, 0.92) 60%);
      backdrop-filter: blur(14px) saturate(120%);
      -webkit-backdrop-filter: blur(14px) saturate(120%);
    }

    #setupOverlay.open {
      display: flex;
      animation: setupFade 0.35s ease both;
    }

    @keyframes setupFade { from { opacity: 0; } to { opacity: 1; } }

    .setup-card {
      position: relative;
      width: min(720px, 94vw);
      max-height: 92dvh;
      overflow-y: auto;
      padding: 30px 34px 34px;
      border-radius: 22px;
      background: var(--app-bg-gradient-modal, linear-gradient(160deg, #375280 0%, #2e4570 100%));
      border: 1px solid rgba(91, 156, 245, 0.28);
      box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(59, 125, 216, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
      transform: translateY(14px) scale(0.985);
      animation: setupRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
    }

    @keyframes setupRise {
      to { transform: translateY(0) scale(1); }
    }

    .setup-card::before {
      content: '';
      position: absolute;
      top: -1px; left: 24px; right: 24px; height: 1px;
      background: linear-gradient(90deg, transparent, rgba(91, 156, 245, 0.6), transparent);
    }

    .setup-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 22px;
    }

    .setup-logo { display: flex; align-items: center; }
    .setup-logo img { height: 26px; width: auto; opacity: 0.95; }

    .setup-close {
      width: 38px; height: 38px;
      border: 1px solid rgba(91, 156, 245, 0.22);
      border-radius: 12px;
      background: rgba(91, 156, 245, 0.10);
      color: var(--app-text-secondary, #97a5be);
      font-size: 22px; line-height: 1;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.2s, color 0.2s, transform 0.15s;
    }
    .setup-close:hover { background: rgba(239, 68, 68, 0.16); color: #fff; transform: rotate(90deg); }

    .setup-eyebrow {
      font-family: var(--app-font-mono, monospace);
      font-size: 11px;
      letter-spacing: 3px;
      text-transform: uppercase;
      color: var(--app-accent-primary, #5b9cf5);
      margin-bottom: 10px;
      animation: setupItem 0.5s ease 0.10s both;
    }

    .setup-question {
      font-size: clamp(24px, 4.4vw, 34px);
      font-weight: 700;
      line-height: 1.15;
      letter-spacing: -0.5px;
      color: var(--app-text-primary, #edf1f8);
      margin-bottom: 10px;
      animation: setupItem 0.5s ease 0.16s both;
    }

    .setup-sub {
      font-size: 14px;
      line-height: 1.5;
      color: var(--app-text-secondary, #97a5be);
      margin-bottom: 22px;
      animation: setupItem 0.5s ease 0.22s both;
    }

    @keyframes setupItem {
      from { opacity: 0; transform: translateY(8px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .setup-input-wrap {
      position: relative;
      animation: setupItem 0.5s ease 0.28s both;
    }

    #setupPromptInput {
      width: 100%;
      min-height: 150px;
      resize: vertical;
      padding: 18px 60px 18px 18px;
      border-radius: 16px;
      border: 1px solid rgba(91, 156, 245, 0.25);
      background: var(--app-overlay-input-bg);
      color: var(--app-text-primary, #edf1f8);
      font-family: var(--app-font-body, sans-serif);
      font-size: 16px;
      line-height: 1.55;
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    #setupPromptInput::placeholder { color: var(--app-text-muted, #5a6a80); }
    #setupPromptInput:focus {
      border-color: rgba(91, 156, 245, 0.6);
      box-shadow: 0 0 0 4px rgba(91, 156, 245, 0.12), 0 0 24px rgba(59, 125, 216, 0.18);
    }

    .setup-mic {
      position: absolute;
      bottom: 14px; right: 14px;
      width: 40px; height: 40px;
      border: 1px solid rgba(91, 156, 245, 0.3);
      border-radius: 50%;
      background: rgb(var(--app-accent-rgb) / .14);
      color: var(--app-accent-primary, #5b9cf5);
      font-size: 15px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.2s, color 0.2s, transform 0.15s;
    }
    .setup-mic:hover { background: rgba(91, 156, 245, 0.26); transform: scale(1.06); }
    .setup-mic.recording {
      background: var(--app-mic-bg);
      color: #fff;
      border-color: var(--app-mic-bg);
      animation: setupPulse 1.3s ease-in-out infinite;
    }
    @keyframes setupPulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
      50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    }

    .setup-msg {
      display: none;
      margin-top: 16px;
      padding: 12px 14px;
      border-radius: 12px;
      font-size: 14px;
      line-height: 1.45;
    }
    .setup-msg.show { display: block; animation: setupItem 0.3s ease both; }
    .setup-msg.warn { background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.4); color: #fcd97a; }
    .setup-msg.error { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.4); color: #ffb3b3; }
    .setup-msg.info { background: rgba(91, 156, 245, 0.12); border: 1px solid rgba(91, 156, 245, 0.4); color: #cfe0fb; }

    .setup-footer {
      margin-top: 24px;
      animation: setupItem 0.5s ease 0.34s both;
    }

    .setup-submit {
      width: 100%;
      padding: 16px 22px;
      border: none;
      border-radius: 14px;
      background: var(--app-cta-bg);
      color: var(--app-cta-text);
      font-family: var(--app-font-body, sans-serif);
      font-size: 16px;
      font-weight: 700;
      letter-spacing: 0.2px;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center; gap: 10px;
      box-shadow: 0 8px 26px rgba(37, 99, 235, 0.4);
      transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    }
    .setup-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5); }
    .setup-submit:active:not(:disabled) { transform: translateY(0); }
    .setup-submit:disabled { opacity: 0.7; cursor: progress; }

    .setup-spinner {
      width: 17px; height: 17px;
      border: 2px solid rgba(255, 255, 255, 0.4);
      border-top-color: #fff;
      border-radius: 50%;
      animation: setupSpin 0.8s linear infinite;
      display: none;
    }
    .setup-submit.loading .setup-spinner { display: inline-block; }
    @keyframes setupSpin { to { transform: rotate(360deg); } }

    .setup-launcher {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      margin-bottom: 16px;
      padding: 14px 16px;
      border: 1px solid var(--app-launcher-border);
      border-radius: 14px;
      background: linear-gradient(135deg, rgba(91, 156, 245, 0.16), rgba(37, 99, 235, 0.10));
      color: var(--app-text-primary, #edf1f8);
      font-family: var(--app-font-body, sans-serif);
      font-size: 15px;
      font-weight: 600;
      text-align: left;
      cursor: pointer;
      transition: background 0.2s, transform 0.15s, border-color 0.2s;
    }
    .setup-launcher:hover { background: linear-gradient(135deg, rgba(91, 156, 245, 0.26), rgba(37, 99, 235, 0.18)); transform: translateY(-1px); border-color: rgba(91, 156, 245, 0.5); }
    .setup-launcher i { color: var(--app-accent-primary, #5b9cf5); font-size: 18px; }
    .setup-launcher .setup-launcher-sub { display: block; font-size: 12px; font-weight: 400; color: var(--app-text-secondary, #97a5be); margin-top: 2px; }

    /* ===== Theme switcher: header button + popover menu ===== */
    .header-icon-btn {
      position: absolute;
      right: 64px;
      cursor: pointer;
      padding: 10px;
      border-radius: 10px;
      background: transparent;
      border: 0;
      line-height: 0;
      transition: background 0.25s ease;
    }
    .header-icon-btn:hover { background: rgb(var(--app-accent-rgb, 91 156 245) / .08); }
    .header-icon-btn i { color: var(--app-accent-primary, #5b9cf5); font-size: 20px; }

    .theme-menu {
      position: fixed;
      top: 64px;
      right: 16px;
      z-index: var(--layer-dialog, 1600);
      min-width: 212px;
      background: var(--app-modal-bg);
      border: 1px solid var(--app-card-border, rgba(91, 156, 245, 0.2));
      border-radius: var(--radius-lg, 16px);
      box-shadow: var(--shadow-3, 0 16px 48px rgba(0, 0, 0, 0.5));
      padding: 6px;
      opacity: 0;
      transform: translateY(-6px) scale(0.98);
      transform-origin: top right;
      transition: opacity 0.2s var(--ease-out, ease), transform 0.2s var(--ease-out, ease);
    }
    .theme-menu.open { opacity: 1; transform: none; }
    .theme-option {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 100%;
      padding: 10px 12px;
      min-height: 44px;
      background: transparent;
      border: 0;
      border-radius: var(--radius-md, 12px);
      cursor: pointer;
      color: var(--app-text-primary, #edf1f8);
      font: inherit;
      text-align: left;
    }
    .theme-option:hover { background: rgb(var(--app-accent-rgb, 91 156 245) / .12); }
    .theme-swatch { display: inline-flex; gap: 2px; flex: 0 0 auto; }
    .theme-swatch i { width: 12px; height: 18px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.18); }
    .theme-name { flex: 1; }
    .theme-check { opacity: 0; color: var(--app-accent-primary, #5b9cf5); font-weight: 700; }
    .theme-option[aria-checked="true"] { outline: 1px solid var(--app-card-border-hover, rgba(91, 156, 245, 0.4)); }
    .theme-option[aria-checked="true"] .theme-check { opacity: 1; }
    @media (prefers-reduced-motion: reduce) { .theme-menu { transition: none; } }
