/* ============ SquareWorks Designer 2026 — parody UI ============ */

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

:root {
  --chrome: #ececec;
  --chrome-dark: #d6d6d6;
  --border: #b5b5b5;
  --text: #1d1d1f;
  --disabled: #a8a8a8;
  --accent: #2456a4;
  --splash-bg: #0d1b2e;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  background: #7a7a7a;
}

.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ======================= SPLASH ======================= */
#splash {
  background: var(--splash-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-window {
  width: 770px;
  height: 520px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.splash-left {
  flex: 1;
  padding: 34px 30px 26px;
  display: flex;
  flex-direction: column;
}

.splash-brand { display: flex; align-items: center; gap: 14px; }

.splash-logo {
  width: 54px; height: 54px;
  border: 3px solid #000;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
}

.splash-wordmark { display: flex; flex-direction: column; border-left: 2px solid #000; padding-left: 14px; }
.wordmark-text { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.wordmark-text sup { font-size: 10px; }
.wordmark-sub { font-size: 8px; letter-spacing: 2px; margin-top: 2px; align-self: flex-end; }

.splash-info { margin-top: auto; font-size: 11.5px; line-height: 1.5; }
.info-row { display: flex; margin-bottom: 3px; }
.info-label { width: 130px; text-align: right; margin-right: 8px; flex-shrink: 0; color: #333; }
.info-row span:last-child { color: #1a3f7a; }

.splash-status { margin-top: 26px; font-size: 12px; color: #333; min-height: 16px; }

.splash-right { width: 355px; padding: 12px; display: flex; }

/* CSS-only "architectural photograph": a heroic tower of squares */
.splash-art {
  flex: 1;
  border-radius: 6px;
  background:
    /* the tower */
    repeating-linear-gradient(0deg,   #8d9aa8 0 26px, #cfd8e0 26px 30px),
    repeating-linear-gradient(90deg,  rgba(40,55,70,.35) 0 26px, rgba(255,255,255,.25) 26px 30px),
    linear-gradient(160deg, #dfe8f0 0%, #9fb2c4 45%, #5c728a 100%),
    linear-gradient(160deg, #e8eef4, #7e93a8);
  background-blend-mode: multiply, normal, normal, normal;
  position: relative;
  overflow: hidden;
}
.splash-art::before {
  content: "";
  position: absolute;
  left: 18%; top: -6%;
  width: 64%; height: 112%;
  background:
    repeating-linear-gradient(0deg, rgba(20,30,42,.55) 0 6px, transparent 6px 34px),
    repeating-linear-gradient(90deg, rgba(20,30,42,.45) 0 6px, transparent 6px 34px),
    linear-gradient(200deg, #f4f7fa, #6b8199);
  transform: perspective(600px) rotateY(-14deg);
  box-shadow: -18px 24px 40px rgba(0,0,0,.35);
}
.splash-art::after {
  content: "Pictured: The Quadrangle Tower. Every window is a square. The client wanted circles.";
  position: absolute;
  bottom: 8px; left: 10px; right: 10px;
  font-size: 9px;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* ======================= MAIN APP CHROME ======================= */
#app { display: flex; flex-direction: column; background: #9a9a9a; }

.menubar {
  height: 26px;
  background: linear-gradient(#fdfdfd, #e9e9e9);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 2px;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  z-index: 50;
}
.menu-item { padding: 3px 9px; border-radius: 4px; cursor: default; }
.menu-item.bold { font-weight: 700; }
.menu-item:hover, .menu-item.open { background: var(--accent); color: #fff; }
.apple-menu { font-size: 14px; }
.menubar-title {
  margin-left: auto;
  font-size: 12px; color: #555; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.menu-dropdown {
  position: fixed;
  min-width: 230px;
  background: rgba(248,248,248,.98);
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  padding: 4px 0;
  z-index: 100;
  font-size: 13px;
}
.menu-dropdown .mi {
  padding: 4px 22px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  white-space: nowrap;
}
.menu-dropdown .mi.enabled:hover { background: var(--accent); color: #fff; cursor: default; }
.menu-dropdown .mi.disabled { color: var(--disabled); }
.menu-dropdown .sep { height: 1px; background: #d8d8d8; margin: 4px 10px; }
.menu-dropdown .shortcut { color: #999; }
.menu-dropdown .mi.disabled .shortcut { color: #c4c4c4; }

.doc-toolbar {
  height: 34px;
  background: linear-gradient(#f4f4f4, #e2e2e2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  flex-shrink: 0;
}
.doc-tab {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px 4px 0 0;
  padding: 4px 12px;
  font-size: 12px;
  margin-top: 6px;
  border-bottom: none;
}
.doc-toolbar select {
  font-size: 11px; padding: 2px 4px;
  border: 1px solid var(--border); border-radius: 4px;
  background: #fafafa; color: var(--disabled);
}
.toolbar-msg { font-size: 11px; color: #666; margin-left: 14px; font-style: italic; }

.app-body { flex: 1; display: flex; min-height: 0; }

/* ---- palettes ---- */
.left-panel, .right-panel {
  width: 200px;
  background: var(--chrome);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  overflow-y: auto;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}
.right-panel { border-right: none; border-left: 1px solid var(--border); width: 230px; }

.palette {
  background: #f7f7f7;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
}
.palette.grow { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.palette-title {
  background: linear-gradient(#e8e8e8, #d8d8d8);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  color: #444;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 4px;
}
.tool-grid.small { grid-template-columns: repeat(6, 1fr); }
.tool-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid transparent;
  color: var(--disabled);
  cursor: not-allowed;
  user-select: none;
  background: #f0f0f0;
}
.tool-btn.enabled {
  color: #111;
  cursor: crosshair;
  background: #fff;
  border-color: #c9c9c9;
}
.tool-btn.enabled.active {
  background: #cfe0f7;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.tool-btn svg { width: 18px; height: 18px; }
.tool-btn:not(.enabled) svg { opacity: .32; }

.attr-body { padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; }
.attr-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #666; }
.attr-row select { flex: 1; font-size: 10px; color: var(--disabled); }
.attr-swatch { width: 16px; height: 16px; border: 1px solid #999; display: inline-block; }
.attr-swatch.white { background: #fff; }
.attr-swatch.black { background: #000; }

.toolset-list { display: flex; flex-direction: column; overflow-y: auto; flex: 1; }
.toolset-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  color: var(--disabled);
  cursor: not-allowed;
  user-select: none;
  border-bottom: 1px solid #eee;
}
.toolset-row .ts-icon { width: 16px; text-align: center; opacity: .4; }
.toolset-row:hover { background: #ececec; }
.toolset-row.enabled { color: #111; cursor: pointer; }
.toolset-row.enabled .ts-icon { opacity: 1; }

/* ---- canvas ---- */
.canvas-wrap {
  flex: 1;
  background: #8f8f8f;
  position: relative;
  overflow: hidden;
}
#canvas { position: absolute; inset: 0; cursor: crosshair; }

/* ---- object info ---- */
.oi-tabs { display: flex; border-bottom: 1px solid var(--border); background: #ececec; }
.oi-tab { padding: 3px 12px; font-size: 11px; color: #888; }
.oi-tab.active { background: #f7f7f7; color: #222; border-right: 1px solid var(--border); font-weight: 600; }
.oi-body { padding: 8px; font-size: 11.5px; flex: 1; overflow-y: auto; }
.oi-none { color: #999; padding-top: 6px; }
.oi-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted #e0e0e0; }
.oi-row .oi-label { color: #555; }
.oi-row .oi-val { font-family: "SF Mono", Menlo, monospace; font-size: 11px; }
.oi-note { margin-top: 8px; font-size: 10px; color: #a06a00; font-style: italic; line-height: 1.4; }

.sheet-list { flex: 1; overflow-y: auto; }
.sheet-row {
  display: flex; gap: 10px; padding: 3px 8px;
  font-size: 11px; border-bottom: 1px solid #eee;
}
.sheet-row span:first-child { width: 40px; font-weight: 600; }
.sheet-row.disabled { color: var(--disabled); }

/* ---- status bar ---- */
.statusbar {
  height: 22px;
  background: linear-gradient(#efefef, #e0e0e0);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 12px;
  font-size: 11px;
  color: #555;
  flex-shrink: 0;
}
#status-squares { margin-left: auto; }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30,30,30,.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  max-width: 480px;
  text-align: center;
  z-index: 300;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  line-height: 1.4;
}

/* ======================= DIALOGS ======================= */
.dialog-layer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

/* macOS-style dialog */
.dlg-mac {
  width: 460px;
  background: #f2f2f2;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  padding: 22px 22px 18px;
  animation: dlg-pop .18s ease-out;
}
@keyframes dlg-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.dlg-mac .dlg-head { display: flex; gap: 16px; }
.dlg-icon {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 12px;
  background: #111;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.dlg-icon.warn { background: #f6c343; color: #7a5b00; }
.dlg-icon.sales { background: linear-gradient(135deg, #2456a4, #6a3fb8); }
.dlg-text h3 { font-size: 14px; margin-bottom: 6px; }
.dlg-text p { font-size: 12px; line-height: 1.5; color: #333; }
.dlg-text p + p { margin-top: 8px; }
.dlg-text .fine { font-size: 10px; color: #888; margin-top: 10px; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.btn {
  font-size: 12.5px;
  padding: 5px 16px;
  border-radius: 6px;
  border: 1px solid #c8c8c8;
  background: linear-gradient(#fff, #f0f0f0);
  cursor: pointer;
}
.btn:hover { background: #fafafa; }
.btn.primary {
  background: linear-gradient(#3d7de0, var(--accent));
  border-color: #1c4487;
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }

/* Windows-style dialog (for the inexplicably Windows "Server Busy" moment) */
.dlg-win {
  width: 420px;
  background: #f0f0f0;
  border: 1px solid #707070;
  box-shadow: 0 16px 50px rgba(0,0,0,.55);
  font-family: "Segoe UI", Tahoma, sans-serif;
  animation: dlg-pop .18s ease-out;
}
.dlg-win .win-titlebar {
  background: #fff;
  padding: 6px 10px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #d0d0d0;
}
.dlg-win .win-close { color: #333; cursor: pointer; padding: 0 6px; }
.dlg-win .win-close:hover { background: #e81123; color: #fff; }
.dlg-win .win-body { padding: 18px 16px; display: flex; gap: 14px; font-size: 12px; line-height: 1.5; }
.dlg-win .win-icon { font-size: 30px; }
.dlg-win .win-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 0 16px 14px; }
.dlg-win .btn { border-radius: 2px; background: #e1e1e1; border-color: #adadad; }
.dlg-win .btn.primary { background: #e5f1fb; border: 2px solid #0078d7; color: #000; font-weight: 400; }

/* progress dialog */
.dlg-progress { margin-top: 14px; }
.progress-track {
  height: 8px;
  background: #dcdcdc;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #c2c2c2;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3d7de0, #2456a4);
  transition: width .25s ease;
}
.progress-label { font-size: 11px; color: #666; margin-top: 6px; }

/* 2027 upsell dialog */
.dlg-upsell {
  width: 620px;
  background: var(--splash-bg);
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,.7);
  animation: dlg-pop .22s ease-out;
}
.upsell-hero {
  padding: 30px 34px 20px;
  background:
    radial-gradient(circle at 80% 20%, rgba(106,63,184,.5), transparent 55%),
    radial-gradient(circle at 15% 90%, rgba(36,86,164,.6), transparent 50%);
}
.upsell-kicker { font-size: 11px; letter-spacing: 3px; color: #8fb4ee; margin-bottom: 8px; }
.upsell-hero h2 { font-size: 30px; font-weight: 800; line-height: 1.15; }
.upsell-hero h2 .gradient { background: linear-gradient(90deg, #7db2ff, #c79bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.upsell-sub { margin-top: 10px; font-size: 13px; color: #b9c8de; line-height: 1.5; }
.upsell-features { padding: 6px 34px 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.upsell-feature { font-size: 12px; color: #d7e2f2; display: flex; gap: 8px; line-height: 1.45; }
.upsell-feature .tick { color: #6fd18a; }
.upsell-price { padding: 16px 34px 4px; font-size: 13px; color: #b9c8de; }
.upsell-price .amount { font-size: 26px; color: #fff; font-weight: 800; }
.upsell-price .was { text-decoration: line-through; color: #6d7f99; margin-left: 8px; }
.upsell-buttons { display: flex; gap: 10px; padding: 18px 34px 26px; }
.btn.cta {
  background: linear-gradient(90deg, #3d7de0, #7a4fd0);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 26px;
  border-radius: 8px;
}
.btn.ghost {
  background: transparent;
  border: 1px solid #3a4c66;
  color: #8fa2bd;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
}
.btn.ghost:hover { color: #c6d4e8; border-color: #5a729a; }
.upsell-fine { padding: 0 34px 20px; font-size: 9.5px; color: #586d84; line-height: 1.5; }

/* beachball */
.beachball {
  position: fixed;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: conic-gradient(#ff595e, #ffca3a, #8ac926, #1982c4, #6a4c93, #ff595e);
  animation: spin .8s linear infinite;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================= SQUAREY ======================= */
.squarey {
  position: fixed;
  right: 250px;
  bottom: 40px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  animation: squarey-in .3s ease-out;
}
@keyframes squarey-in { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.squarey-bubble {
  background: #fffbe8;
  border: 1px solid #d9c86a;
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  position: relative;
}
.squarey-bubble::after {
  content: "";
  position: absolute;
  bottom: -8px; right: 24px;
  border: 8px solid transparent;
  border-top-color: #d9c86a;
  border-bottom: none;
}
.squarey-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.btn.tiny { font-size: 10.5px; padding: 3px 10px; }

.squarey-face {
  width: 52px; height: 52px;
  background: #fff;
  border: 3px solid #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: squarey-bounce 2.2s ease-in-out infinite;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
@keyframes squarey-bounce { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-5px) rotate(2deg); } }
.squarey-eyes { display: flex; gap: 10px; }
.squarey-eyes span { width: 6px; height: 6px; background: #111; border-radius: 0; animation: squarey-blink 3.5s infinite; }
@keyframes squarey-blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.squarey-mouth { width: 16px; height: 3px; background: #111; }

/* ======================= EULA ======================= */
.eula-scroll {
  height: 180px;
  overflow-y: scroll;
  border: 1px solid #c8c8c8;
  background: #fff;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 12px;
  color: #333;
}
.eula-scroll ul { padding-left: 18px; }
.eula-scroll li { margin-bottom: 6px; }
.eula-scroll h4 { margin: 10px 0 6px; font-size: 11px; }

/* ======================= SURVEY ======================= */
.nps-row { display: flex; gap: 5px; margin-top: 14px; justify-content: center; }
.nps-btn {
  width: 30px; height: 30px;
  border: 1px solid #c0c0c0;
  border-radius: 6px;
  background: #f4f4f4;
  color: #c0c0c0;
  font-size: 12.5px;
  cursor: not-allowed;
  display: flex; align-items: center; justify-content: center;
}
.nps-btn.enabled {
  background: linear-gradient(#3d7de0, var(--accent));
  color: #fff;
  border-color: #1c4487;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(61,125,224,.25);
}
.nps-labels { display: flex; justify-content: space-between; font-size: 9.5px; color: #999; margin-top: 5px; padding: 0 4px; }

/* ======================= UPSELL COUNTDOWN ======================= */
.upsell-countdown {
  margin: 0 34px;
  padding: 8px 14px;
  background: rgba(232,76,76,.12);
  border: 1px solid rgba(232,76,76,.45);
  border-radius: 8px;
  font-size: 12px;
  color: #ff9e9e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.upsell-countdown .clock { font-family: "SF Mono", Menlo, monospace; font-weight: 700; color: #ff6b6b; font-size: 15px; }
.upsell-countdown .extended { font-size: 10px; color: #d98a8a; font-style: italic; }

/* ======================= COOKIE BANNER ======================= */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1c1c22;
  color: #d8d8de;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  line-height: 1.45;
  z-index: 600;
  box-shadow: 0 -6px 24px rgba(0,0,0,.4);
}
.cookie-buttons { display: flex; gap: 8px; flex-shrink: 0; }

/* ======================= KERNEL PANIC ======================= */
.dlg-panic {
  width: 100vw;
  height: 100vh;
  background: rgba(8, 10, 16, .97);
  color: #e8e8ec;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  font-family: "Lucida Grande", -apple-system, sans-serif;
}
.panic-text { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.panic-text .panic-en { font-size: 20px; font-weight: 700; }
.panic-text p { font-size: 13px; color: #b8b8c2; line-height: 1.5; }
.panic-text .panic-tech {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  color: #6a6a78;
  margin-top: 10px;
}

/* frozen state: everything stops responding */
.frozen { pointer-events: none; filter: saturate(.85); }
.frozen * { cursor: wait !important; }
