/* =====================================================
   EDITOR UI — CLEAN, STABLE, FINAL
===================================================== */

/* -------------------------------
   BASE RESET
-------------------------------- */

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

html,
body {
  margin: 0;
  padding: 12px 0;
}

body {
  background: #2b579a;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  
  color: #000;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;

}



/* =====================================================
   APP ROOT (STACKING CONTEXT)
===================================================== */

.editor-app {
  position: relative;
  z-index: 1;               /* ← critical */
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* =====================================================
   DESKTOP BACKGROUND LAYER
===================================================== */

.desktop-layer {
  position: fixed;
  inset: 0;
  padding: 40px 24px 24px 24px;

  /* 🔑 create stacking context */
  z-index: 0;
  isolation: isolate;

  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.15), transparent 40%),
    linear-gradient(#2b579a, #1b3c6d);

    display: grid;
  grid-auto-flow: column;     /* 🔑 fill down, then right */
  grid-auto-columns: 90px;    /* column width */
  grid-template-rows: repeat(7, auto); /* 🔑 7 items per column */

  gap: 12px 16px;
  align-items: start;
}


.desktop-layer::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image: url('/assets/images/desktop-photos/presidential-seal.png');
  background-repeat: no-repeat;

  /* ⬇️ offset from center */
  background-position: 6% 25%;
  /* or: 52% 48%, left 55% top 46%, etc */

  background-size: 800px;
  opacity: 0.09;

  z-index: 1;
  pointer-events: none;
}



/* Desktop icons (explicit hit areas restored later if needed) */
.desktop-icon {
  display: block;
  width: 140px;
  margin-bottom: 28px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  pointer-events: auto;
}

.desktop-icon .icon {
  font-size: 40px;
  display: block;
  margin-bottom: 8px;
}

.desktop-icon .label {
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.desktop-icon:hover .label {
  text-decoration: underline;
}

/* =====================================================
   EDITOR WINDOW (WORD)
===================================================== */

.editor-window {
  position: relative;
  z-index: 2;

  width: min(900px, 94vw);
  height: 82vh;
  margin: 40px auto;

  background: #f2f2f2;
  border: 1px solid #9c9c9c;

  box-shadow:
    0 8px 24px rgba(0,0,0,0.25),
    inset 0 0 0 1px #ffffff;

  display: flex;
  flex-direction: column;
}

/* -------------------------------
   MENU BAR
-------------------------------- */

.editor-menu {
  display: flex;
  gap: 18px;
  padding: 6px 12px;
  font-size: 13px;
  background: #e5e5e5;
  border-bottom: 1px solid #b5b5b5;
  user-select: none;
}

.menu-item {
  position: relative;
}

.menu-label {
  padding: 6px 8px;
  cursor: default;
}

/* Dropdown */
.submenu {
  display: none;
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #8f8f8f;
  z-index: 9999;
}

.menu-item:hover .submenu,
.submenu:hover {
  display: block;
}

.submenu a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
}

.submenu a:hover {
  background: #2b579a;
  color: #fff;
}

/* -------------------------------
   TITLE BAR
-------------------------------- */

.editor-title {
  padding: 4px 12px;
  font-size: 12px;
  background: #dcdcdc;
  border-bottom: 1px solid #bcbcbc;
}

/* -------------------------------
   TOOLBAR
-------------------------------- */

.editor-toolbar {
  padding: 6px 12px;
  background: #efefef;
  border-bottom: 1px solid #cfcfcf;
}

.toolbar-btn {
  margin-right: 12px;
  font-size: 12px;
  text-decoration: none;
  color: #000;
}

/* -------------------------------
   DOCUMENT
-------------------------------- */

.editor-document {
  flex: 1;
  background: #fff;
  padding: 36px 48px;
  overflow-y: auto;

  font-family: "Courier Prime", monospace;
  font-size: 15px;
  line-height: 1.6;
}

.editor-document p {
  margin: 0 0 14px;
}

/* =====================================================
   INLINE EDITOR ADS (DOCUMENT-NATIVE)
===================================================== */

.editor-ad {
  margin: 28px 0;
  font-family: "Courier Prime", monospace;
}

.editor-ad-inner {
  border: 1px solid #9c9c9c;
  background: #f7f7f7;
}

.editor-ad-badge {
  padding: 6px 12px;
  background: #e6e6e6;
  border-bottom: 1px solid #9c9c9c;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

.editor-ad-content {
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
}

.editor-ad-cta {
  font-size: 13px;
  text-decoration: underline;
}

/* =====================================================
   ARCHIVE / SEARCH FILE LIST
===================================================== */

.editor-document ul {
  list-style: none;
  padding: 0;
}

.editor-document li {
  padding: 6px 0;
}

.editor-document li a {
  color: #000;
  text-decoration: none;
}

.editor-document li a::before {
  content: "📄 ";
}

.editor-document li a:hover {
  text-decoration: underline;
}

/* =====================================================
   MOBILE — EDITOR FIRST
===================================================== */

@media (max-width: 768px) {

  body {
    background: #d4d0c8;
  }

  /* Desktop → top strip */
  .desktop-layer {
    position: static;
    display: flex;
    justify-content: space-around;
    align-items: center;

    padding: 10px 6px;
    background: #cfcfcf;
    border-bottom: 1px solid #9a9a9a;
    pointer-events: auto;
  }

  .desktop-icon {
    width: auto;
    margin: 0;
  }

  .desktop-icon .icon {
    font-size: 26px;
    margin-bottom: 2px;
  }

  .desktop-icon .label {
    font-size: 11px;
    color: #000;
    text-shadow: none;
  }

  /* Editor fills viewport */
  .editor-window {
    width: 100%;
    height: auto;
    margin: 0;
    border: none;
    box-shadow: none;
  }

  .editor-menu {
    position: sticky;
    top: 0;
    z-index: 3000;
  }

  .editor-document {
    padding: 16px 14px 24px;
    font-size: 16px;
  }
}

/* =====================================================
   EDITOR MENU — WORD-STYLE (menu-group version)
===================================================== */

.editor-menu {
  display: flex;
  gap: 18px;
  padding: 6px 12px;
  font-size: 13px;
  background: #e5e5e5;
  border-bottom: 1px solid #b5b5b5;
  user-select: none;
  position: relative;
  z-index: 5000;
}

/* Each top-level menu */
.editor-menu .menu-group {
  position: relative;
}

/* Click / hover target */
.editor-menu .menu-label {
  display: inline-block;
  padding: 6px 8px;
  cursor: default;
  color: #000;
  white-space: nowrap;
}

/* Hover highlight like Word */
.editor-menu .menu-group:hover .menu-label {
  background: #d0d0d0;
}

/* Dropdown panel */
.editor-menu .menu-dropdown {
  display: none;
  position: absolute;

  /* overlap by 1px to avoid hover gap */
  top: calc(100% - 1px);
  left: 0;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* KEEP OPEN when hovering parent OR dropdown */
.editor-menu .menu-group:hover .menu-dropdown,
.editor-menu .menu-dropdown:hover {
  display: block;
}

/* Dropdown items */
.editor-menu .menu-dropdown a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

/* Hover state */
.editor-menu .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}

/* =====================================================
   EDITOR DOCUMENT — SPONSORED INSERT
   (Styles existing ad-card markup as Word-style block)
===================================================== */

.editor-document .ad-card.ad-native {
  display: block;
  margin: 28px 0;
  text-decoration: none;
  color: #000;
  font-family: "Courier Prime", monospace;
}

/* Card shell */
.editor-document .ad-card-inner {
  border: 1px solid #9c9c9c;
  background: #f7f7f7;
}

/* Header strip (replaces pill badge) */
.editor-document .ad-badge {
  display: block;
  padding: 6px 12px;
  background: #e6e6e6;
  border-bottom: 1px solid #9c9c9c;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #555;
}

/* Content */
.editor-document .ad-content {
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

/* Headline */
.editor-document .ad-headline {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

/* Body copy */
.editor-document .ad-copy {
  margin: 0 0 8px;
  font-style: italic;
  color: #444;
}

/* CTA link */
.editor-document .ad-cta {
  font-size: 13px;
  text-decoration: underline;
  color: #000;
}

.editor-document .ad-cta::before {
  content: "External link: ";
  color: #666;
}

/* Subtle hover — document, not card */
.editor-document .ad-card.ad-native:hover .ad-card-inner {
  background: #f0f0f0;
  border-color: #6b6b6b;
}

/* =====================================================
   PHOTOS WINDOW
===================================================== */



.photos-window {
  position: fixed;
  top: 120px;
  left: 180px;
  width: 640px;
  height: 420px;

  background: #f2f2f2;
  border: 1px solid #9c9c9c;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);

  display: none;              /* 🔑 THIS */
  flex-direction: column;
  z-index: 3000;
}


/* Title bar */
.photos-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #dcdcdc;
  border-bottom: 1px solid #bcbcbc;
  font-size: 13px;
}

.photos-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* Grid */
.photos-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  overflow-y: auto;
  background: #ffffff;
}

.photos-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid #ccc;
  cursor: pointer;
}



.photo-viewer {
  display: none; /* critical */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}


.photo-viewer img {
  max-width: 90vw;
  max-height: 90vh;
}

.photo-viewer button {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.viewer-prev { left: 20px; }
.viewer-next { right: 20px; }
.viewer-close { top: 20px; right: 20px; }

.photos-titlebar {
  background: #e5e5e5;
  padding: 6px 10px;
  border-bottom: 1px solid #b5b5b5;

  display: flex;
  justify-content: space-between;
  align-items: center;

  cursor: move;
  user-select: none;
}

.photo-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Image stays centered */
.photo-viewer .viewer-image {
  max-width: 90vw;
  max-height: 80vh;
}

/* Filename UNDER the image */
.photo-viewer .photo-filename {
  margin-top: 10px;
  font-size: 11px;
  color: #666;
  text-align: center;
  word-break: break-all;
}

/* Position nav buttons over the image */
.photo-viewer .viewer-prev,
.photo-viewer .viewer-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.photo-viewer .viewer-prev {
  left: 16px;
}

.photo-viewer .viewer-next {
  right: 16px;
}

/* Close button stays top-right */
.photo-viewer .viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
}


/* =====================================================
   MOBILE LAYOUT — FINAL, AUTHORITATIVE
===================================================== */

@media (max-width: 768px) {

  /* ---- Reset flow ownership ---- */

  body {
    background: #d4d0c8;
    overflow-y: auto;
  }

  .editor-app {
    display: block;
    min-height: auto;
  }

  /* ---- Desktop becomes top bar ---- */

  .desktop-layer {
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;

    padding: 8px 6px;
    background: #cfcfcf;
    border-bottom: 1px solid #9a9a9a;

    z-index: 5;
  }

  .desktop-layer::before {
    display: none; /* no watermark on mobile */
  }

  .desktop-icon {
    width: auto;
    margin: 0;
  }

  .desktop-icon .icon {
    font-size: 24px;
    margin-bottom: 2px;
  }

  .desktop-icon .label {
    font-size: 11px;
    color: #000;
    text-shadow: none;
  }

  /* ---- Editor is primary viewport ---- */

  .editor-window {
    position: relative;
    width: 100%;
    height: auto;
    margin: 0;

    border: none;
    box-shadow: none;
  }

  /* Sticky Word menu */
  .editor-menu {
    position: sticky;
    top: 0;
    z-index: 10;
  }

  /* Disable hover dropdowns on mobile (tap-only UX later) */
  .editor-menu .menu-dropdown {
    display: none !important;
  }

  /* ---- Document scroll ---- */

  .editor-document {
    padding: 16px 14px 24px;
    font-size: 16px;

    overflow: visible; /* body scrolls */
  }

  /* ---- Photos window = fullscreen modal ---- */

  .photos-window {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;
    left: 0 !important;
    top: 0 !important;

    border: none;
    box-shadow: none;
    z-index: 9999;
  }

  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }

}
@media (max-width: 768px) {

   
  .editor-menu {
    display: none;
  }



  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    background: #f7f7f7;
    z-index: 9999;

    display: flex;
    flex-direction: column;
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 16px;
    background: #e6e6e6;
    border-bottom: 1px solid #9a9a9a;
  }

  .mobile-menu-title {
    font-size: 16px;
    font-weight: 600;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
  }

  .mobile-menu-links {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .mobile-menu-links a {
    font-size: 18px;
    text-decoration: none;
    color: #000;
  }

  .mobile-menu-links hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 8px 0;
  }
}
/* =====================================================
   MOBILE MENU — HARD CLOSED BY DEFAULT
===================================================== */

.mobile-menu-panel {
  display: none;
}

.mobile-menu-panel.is-open {
  display: block;
}

/* =====================================================
   MOBILE TOP BAR (HOME + HAMBURGER)
===================================================== */

@media (max-width: 768px) {

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 4000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 8px 12px;
    background: #e5e5e5;
    border-bottom: 1px solid #b5b5b5;

    font-size: 14px;
  }

  .mobile-home {
    text-decoration: underline;
    color: #2b579a;
    font-weight: 600;
  }

  .mobile-menu-toggle {
    background: #f2f2f2;
    border: 1px solid #9c9c9c;
    padding: 4px 8px;
    font-size: 18px;
    cursor: pointer;
  }
}

/* =====================================================
   MOBILE MENU PANEL
===================================================== */

@media (max-width: 768px) {

  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    z-index: 5000;

    background: #f2f2f2;
    display: none;
    flex-direction: column;
  }

  .mobile-menu-panel.is-open {
    display: flex;
  }

  .mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 12px;
    background: #dcdcdc;
    border-bottom: 1px solid #bcbcbc;
  }

  .mobile-menu-title {
    font-size: 14px;
    font-weight: 600;
  }

  .mobile-menu-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
  }

  .mobile-menu-links {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
  }

  .mobile-menu-links a {
    text-decoration: none;
    color: #000;
  }

  .mobile-menu-links a:hover {
    text-decoration: underline;
  }

  .mobile-menu-links hr {
    margin: 12px 0;
    border: none;
    border-top: 1px solid #bbb;
  }
}


/* =====================================================
   FOOTER — FLOATING DESKTOP TEXT
===================================================== */

.footer {
  position: relative;
  z-index: 2; /* above desktop layer */

  margin: 0px 50px 16px;
  padding: 0 18px;

  font-size: 13px;
  line-height: 1.5;
  text-align: center;

  color: rgba(255,255,255,0.6);
}

/* Links */
.footer a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Spacing */
.footer p {
  margin: 6px 0;
}


@media (max-width: 768px) {
  .footer {
    margin: 20px 0 28px;
    padding: 16px 14px;

    background: #ffffff;   /* 🔑 THIS is missing */
    
    font-size: 14px;
    color: #444;
    text-align: center;
  }

  /* 🔑 selector fix: .footer a (not footer a) */
  .footer a {
    color: #2b579a;
    text-decoration: none;
  }

  .footer a:hover {
    text-decoration: underline;
  }
}

/* Toolbar layout helpers */
.editor-toolbar {
  display: flex;
  align-items: center;
}

.toolbar-spacer {
  flex: 1;
}

/* Share dropdown alignment */
.menu-dropdown-right {
  right: 0;
  left: auto;
}

.menu-dropdown hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0;
}

@media print {
  body {
    background: #fff !important;
  }

  .desktop-layer,
  .editor-menu,
  .editor-toolbar {
    display: none !important;
  }

  .editor-window {
    border: none;
    box-shadow: none;
    height: auto;
  }

  .editor-document {
    padding: 0;
    font-size: 12pt;
  }
}
@media print {
  body {
    background: #fff !important;
  }

  .desktop-layer,
  .editor-menu,
  .editor-toolbar {
    display: none !important;
  }

  .editor-window {
    border: none;
    box-shadow: none;
    height: auto;
  }

  .editor-document {
    padding: 0;
    font-size: 12pt;
  }
}

/* =====================================================
   EDITOR TOOLBAR — HARD STYLING FIX
   (Overrides legacy + menu CSS)
===================================================== */

.editor-window .editor-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 6px 10px;
  background: #efefef;
  font-size: 12px;
}

/* Push actions to right */
.editor-window .toolbar-spacer {
  flex: 1;
}

/* Buttons */
.editor-window .toolbar-btn {
  appearance: none;
  background: #f5f5f5;
  border: 1px solid #bcbcbc;
  border-radius: 2px;

  padding: 4px 10px;
  font-size: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #000;

  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.editor-window .toolbar-btn:hover {
  background: #e6e6e6;
}

.editor-window .toolbar-btn:active {
  background: #dcdcdc;
}

/* =====================================================
   SHARE DROPDOWN — EDITOR ONLY
===================================================== */

.editor-window .toolbar-share {
  position: relative;
}

/* Ensure dropdown appears above document */
.editor-window .toolbar-share .menu-dropdown {
  display: none;
  position: absolute;

  top: calc(100% + 2px);
  right: 0;
  left: auto;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;

  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  z-index: 9999;
}

/* Show on hover */
.editor-window .toolbar-share:hover .menu-dropdown {
  display: block;
}

/* Dropdown links */
.editor-window .toolbar-share .menu-dropdown a {
  display: block;
  padding: 6px 12px;

  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.editor-window .toolbar-share .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}

/* Divider */
.editor-window .toolbar-share .menu-dropdown hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 6px 0;
}

/* =====================================================
   PRINT — LETTER ONLY
===================================================== */

@media print {

  /* ---------- GLOBAL RESET ---------- */

  * {
    background: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    color: #000 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.6;
  }

  /* ---------- HIDE ALL UI ---------- */

  .desktop-layer,
  .editor-menu,
  .editor-toolbar,
  .mobile-bar,
  .mobile-menu-panel,
  .photos-window,
  .photo-viewer,
  .footer,
  .editor-ad,
  .ad-card,
  .toolbar-share,
  .toolbar-btn {
    display: none !important;
  }

  /* ---------- EDITOR WINDOW ---------- */

  .editor-window {
    all: unset;
    display: block;
    width: 100%;
  }

  /* ---------- DOCUMENT CONTENT ---------- */

  .editor-document {
    all: unset;
    display: block;

    padding: 1in;
    max-width: 7.5in;
    margin: 0 auto;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
  }

  /* Paragraphs = clean blocks */
  .editor-document p {
    margin: 0 0 14pt;
    text-align: left;
    white-space: normal;
  }

  /* Links print as text */
  .editor-document a {
    color: #000;
    text-decoration: none;
  }

  /* Optional: show URLs after links */
  .editor-document a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #555;
  }

  /* ---------- PAGE CONTROL ---------- */

  @page {
    margin: 1in;
  }

}

.editor-meta {
  padding: 6px 12px;
  font-size: 12px;
  color: #555;
  background: #fafafa;
  border-bottom: 1px solid #d0d0d0;
  text-align: left;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================================================
   TOOLBAR SHARE — STABLE HOVER FIX
===================================================== */

/* Parent must be hover container */
.toolbar-share {
  position: relative;
}

/* Button */
.toolbar-share .toolbar-btn {
  cursor: default;
}

/* Dropdown panel */
.toolbar-share .menu-dropdown {
  display: none;
  position: absolute;

  /* 🔑 overlap parent by 1px */
  top: calc(100% - 1px);
  right: 0;

  min-width: 220px;
  background: #ffffff;
  border: 1px solid #8f8f8f;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);

  z-index: 9999;
}

/* Keep open when hovering parent OR dropdown */
.toolbar-share:hover .menu-dropdown,
.toolbar-share .menu-dropdown:hover {
  display: block;
}

/* Invisible hover bridge (kills gap) */
.toolbar-share::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 8px;
}

/* Dropdown links */
.toolbar-share .menu-dropdown a {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.toolbar-share .menu-dropdown a:hover {
  background: #2b579a;
  color: #fff;
}

/* =====================================================
   SPREADSHEET WINDOW (EXCEL PARODY)
===================================================== */

.spreadsheet-window {
  position: fixed;
  top: 140px;
  left: 220px;
  width: 720px;
  height: 420px;

  background: #ffffff;
  border: 1px solid #9c9c9c;
  box-shadow: 0 10px 26px rgba(0,0,0,0.3);

  display: none;
  flex-direction: column;
  z-index: 3500;
}

/* Title bar */
.spreadsheet-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #e6e6e6;
  border-bottom: 1px solid #bcbcbc;
  font-size: 13px;
  cursor: move;
}

.spreadsheet-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* Toolbar */
.spreadsheet-toolbar {
  padding: 6px 10px;
  font-size: 12px;
  background: #f2f2f2;
  border-bottom: 1px solid #d0d0d0;
}

.spreadsheet-toolbar span {
  margin-right: 14px;
}

/* Grid area */
.spreadsheet-grid {
  flex: 1;
  overflow: auto;
  padding: 12px;
  background: #fff;
}

/* Table */
.spreadsheet-grid table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}

.spreadsheet-grid th,
.spreadsheet-grid td {
  border: 1px solid #cfcfcf;
  padding: 6px 8px;
  text-align: right;
}

.spreadsheet-grid th {
  background: #f4f4f4;
  font-weight: 600;
  text-align: left;
}

.spreadsheet-grid td:first-child,
.spreadsheet-grid th:first-child {
  text-align: left;
}

/* Profit styling */
.spreadsheet-grid .profit {
  color: #1a7f37;
  font-weight: 600;
}

/* Total row */
.total-label {
  text-align: right;
  font-weight: 700;
  background: #f2f2f2;
}

.total-profit {
  font-weight: 800;
  color: #1a7f37;
  background: #f2f2f2;
}
@media (max-width: 768px) {

  /* Desktop → horizontal scroll dock */
  .desktop-layer {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 14px;

    padding: 10px 12px;

    background: #cfcfcf;
    border-bottom: 1px solid #9a9a9a;

    overflow-x: auto;
    overflow-y: hidden;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }

  /* Hide scrollbar (WebKit) */
  .desktop-layer::-webkit-scrollbar {
    display: none;
  }

  .desktop-icon {
    flex: 0 0 auto; /* 🔑 prevents squishing */
    width: 72px;
    margin: 0;
  }

  .desktop-icon .icon {
    font-size: 26px;
    margin-bottom: 2px;
  }

  .desktop-icon .label {
    font-size: 11px;
    color: #000;
    text-shadow: none;
    white-space: nowrap;
  }
}


@media (max-width: 768px) {

  /* ------------------------------------------------
     FORCE FULLSCREEN — OVERRIDE DESKTOP WINDOW LOGIC
  ------------------------------------------------ */

  .spreadsheet-window {
    position: fixed !important;
    inset: 0 !important;

    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;

    margin: 0 !important;
    transform: none !important;
    left: 0 !important;
    top: 0 !important;

    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    background: #fff;
    z-index: 4000;

    display: none; /* keep your existing open/close logic */
    overflow: hidden; /* critical */
  }

  /* When spreadsheet is open */
  .spreadsheet-window.is-open {
    display: block;
  }

  /* ------------------------------------------------
     TITLE BAR — STICKY, NON-DRAGGABLE
  ------------------------------------------------ */

  .spreadsheet-titlebar {
    position: sticky;
    top: 0;
    z-index: 20;

    cursor: default !important;
    touch-action: manipulation;

    padding-top: env(safe-area-inset-top);
  }

  /* ------------------------------------------------
     BODY — SINGLE SCROLL CONTAINER
  ------------------------------------------------ */

  .spreadsheet-body {
    height: calc(100dvh - var(--spreadsheet-titlebar-height, 44px));
    overflow-y: auto;
    overflow-x: auto;

    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    padding-bottom: env(safe-area-inset-bottom);
  }

  /* ------------------------------------------------
     CONTROLS — THUMB FRIENDLY
  ------------------------------------------------ */

  .spreadsheet-close {
    font-size: 20px;
    padding: 8px 12px;
    line-height: 1;
  }

}


/* =====================================================
   TOP SECRET WINDOW
===================================================== */

.secret-window {
  position: fixed;
  top: 0px;
  left: 100px;
  width: 420px;

  background: #f2f2f2;
  border: 1px solid #7b7b7b;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);

  display: none;              /* 🔑 CRITICAL */
  flex-direction: column;
  z-index: 3000;
}


/* Title bar */
.secret-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 6px 10px;
  background: #dcdcdc;
  border-bottom: 1px solid #bcbcbc;

  font-size: 13px;
  font-weight: 600;
  cursor: move;
  user-select: none;
}

.secret-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

/* Body */
.secret-content {
  padding: 16px 18px;
  font-size: 14px;
  color: #111;
}

.secret-warning {
  font-weight: 700;
  margin-bottom: 12px;
}

.secret-list {
  padding-left: 18px;
  margin-bottom: 14px;
}

.secret-list li {
  margin-bottom: 6px;
}

.secret-meta {
  font-size: 13px;
  color: #555;
  margin-bottom: 14px;
}

.secret-action {
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
}

/* =====================================================
   MOBILE — TOP SECRET WINDOW
===================================================== */

@media (max-width: 768px) {

  .secret-window {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    margin: 0;
    border: none;
    border-radius: 0;

    box-shadow: none;
    background: #f2f2f2;

    display: none;          /* still controlled by JS */
    flex-direction: column;
    z-index: 4000;
  }

  /* Title bar stays visible */
  .secret-titlebar {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #e5e5e5;
    border-bottom: 1px solid #b5b5b5;
  }

  /* Scroll content */
  .secret-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
  }
}

.secret-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
}

.mobile-denied {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mobile-denied-box {
  background: #fff;
  padding: 20px 18px;
  max-width: 280px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
}

.mobile-denied-box h3 {
  margin: 0 0 8px;
}

.mobile-denied-box button {
  margin-top: 12px;
  padding: 6px 14px;
  font-size: 14px;
}

/* =============================================
   REDACTED MODE
============================================= */

.redacted {
  background: #000;
  color: transparent;
  border-radius: 2px;
  padding: 0 2px;
}

.redacted::selection {
  background: #000;
}

/* Line-level redaction */
.redacted-line {
  display: inline-block;
  background: #000;
  height: 1em;
  width: 100%;
  border-radius: 2px;
}

/* ----------------------------------------------
   SURVEY MODAL — MATCH DESKTOP / WINDOW UI
---------------------------------------------- */

.survey-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.survey-modal.hidden {
  display: none;
}

.survey-modal span {font-size: 12px; opacity: .8;}

/* Window-style container */
.survey-modal-inner {
  background: #fdfdfb;
  padding: 22px 24px 20px;
  border-radius: 10px;
  max-width: 420px;
  width: 92%;
  position: relative;
  box-shadow:
    0 12px 28px rgba(0,0,0,0.18),
    0 2px 6px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.08);
  animation: survey-pop 0.18s ease-out;
}

/* Subtle pop-in like other windows */
@keyframes survey-pop {
  from {
    transform: translateY(6px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Close button matches window chrome */
.survey-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: #eee;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.survey-close:hover {
  background: #e2e2e2;
}

/* Title styling */
.survey-modal-inner h3 {
  margin: 4px 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: #111;
}

/* Body copy */
.survey-modal-inner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #444;
}

/* Action row */
.survey-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Primary action — matches app buttons */
.survey-primary {
  background: #111;
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid #000;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.survey-primary:hover {
  background: #000;
}

/* Secondary action — subtle text button */
.survey-secondary {
  background: transparent;
  border: none;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  padding: 7px 10px;
}

.survey-secondary:hover {
  color: #111;
  text-decoration: underline;
}

@media (max-width: 768px) {

  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 5000;

    display: flex;
    flex-direction: column;
  }

  .mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);

    padding-top: calc(14px + env(safe-area-inset-top));
  }

  .mobile-menu-links {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .mobile-menu-panel[hidden] {
  display: none !important;
}
.system-awareness {
  padding-top: calc(12px + env(safe-area-inset-top));
  height: calc(40px + env(safe-area-inset-top));
}

}

.photo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.photo-item img {
  display: block;
  max-width: 100%;
  height: auto;
}

.photo-filename {
  margin-top: 4px;
  font-size: 11px;
  color: #666;
  text-align: center;
  word-break: break-all;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.photo-filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.photo-viewer .photo-filename {
  margin-top: 10px;
  text-align: center;
  font-size: medium;
  opacity: 1;
}

.about-panel {
  
  margin: 24px auto;
  padding: 16px 18px;

  font-size: 13px;
  line-height: 1.5;
  color: #444;

  background: #fafafa;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
}



.about-panel p {
  margin: 0 0 10px;
}

.about-panel p:last-child {
  margin-bottom: 0;
}

.about-panel a {
  color: inherit;
  text-decoration: underline;
}

.about-panel a.desktop-icon {
  text-decoration: none;
  font-weight: 500;
}




.system-awareness {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;


  background: #f6e2ab;
  border-bottom: 1px solid #d6d6d2;

  padding: 6px 16px;
  font-size: 12px;
  color: #555;

  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  z-index: 10000;
}

.system-awareness-text {
  flex: 1;
  min-width: 0;
}

.system-awareness-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  opacity: 0.9;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ea44f; /* secure green */
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}

/* subtle “alive” pulse */
@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46,164,79,0.5); }
  70%  { box-shadow: 0 0 0 4px rgba(46,164,79,0); }
  100% { box-shadow: 0 0 0 0 rgba(46,164,79,0); }
}

.status-dot {
  animation: status-pulse 2.5s infinite;
}

.system-awareness-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
  float: right;
}

/* Mobile wrapping */
@media (max-width: 600px) {
  .system-awareness {
    flex-wrap: wrap;
  }

  .system-awareness-status,
  .system-awareness-time {
    width: 100%;
    text-align: left;
  }
}

.system-awareness {
  pointer-events: none;
}

.system-awareness * {
  pointer-events: auto; /* allow interaction with buttons/text if needed */
}


.editor-window {
  position: relative;
  z-index: 200;
}


.todo-window {
  width: 320px;
  max-width: calc(100vw - 24px);

  /* REQUIRED for DesktopWindow */
  display: flex;
  flex-direction: column;
  border-width: 1px;
    border-style: solid;
    border-color: rgb(156, 156, 156);

  background: #d4d0c8; /* classic Windows gray */
}



/* Body */
.todo-body {
  font-family: "Tahoma", "MS Sans Serif", system-ui, sans-serif;
  font-size: 13px;
  padding: 12px;

  background: #fff;

}

/* Affirmation panel */
.todo-affirmation {
  background: #f2f2f2;
  border: 1px inset #c0c0c0;
  padding: 8px;
  margin-bottom: 10px;
}

.todo-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 4px;
}

.todo-affirmation p {
  margin: 0;
  font-weight: bold;
}

/* List */
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.todo-list li {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  line-height: 1.2;
}

.todo-list li::before {
  content: "☐";
  margin-right: 6px;
  font-family: inherit;
}

.todo-list li.completed {
  text-decoration: line-through;
  color: #777;
}

.todo-list li.completed::before {
  content: "☑";
}

/* Mobile behavior */
@media (max-width: 640px) {
  .todo-window {
    width: 100%;
    max-width: 100%;
    left: 0 !important;
    right: 0;
    top: auto !important;
    bottom: 0;

    border-radius: 0;
  }
}


.todo-list li {
  cursor: default;
}

.todo-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 4px 6px;
  background: #e5e5e5;
  border-bottom: 1px solid #808080;

  user-select: none;
}

.todo-titlebar .window-title {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
}
.todo-titlebar .window-close,
.todo-titlebar .todo-close {
  margin-left: auto;      /* 🔑 pushes it to the far right */
  width: 22px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 14px;
  line-height: 1;

  background: #e5e5e5;
  border: 0px solid #808080;
  cursor: pointer;
}
.todo-titlebar .window-close:hover {
  background: #e5e5e5;
}
