/* Logo Studio — self-contained, matches Cexagon boxed hairline grid */
.ls-root, .ls-root * { box-sizing: border-box }
.ls-root {
  --ls-bg: var(--bg, #0b0b0c);
  --ls-fg: var(--fg, #ececec);
  --ls-mut: var(--mut, #8a8a8f);
  --ls-line: var(--line, #2a2a2e);
  --ls-card: var(--card, #111113);
  --ls-hov: var(--hov, #18181b);
  --ls-acc: var(--acc, #fff);
  --ls-r: 14px;
  --ls-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ls-fg);
  font: 14px/1.5 'Space Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ls-mono { font-family: var(--ls-mono); letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; color: var(--ls-mut) }

.ls-shell { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 16px; align-items: start }
.ls-panel {
  border: 1px solid var(--ls-line); border-radius: var(--ls-r); background: var(--ls-card);
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 72px; max-height: calc(100svh - 88px); overflow: auto;
}
.ls-stage {
  border: 1px solid var(--ls-line); border-radius: var(--ls-r); background: var(--ls-bg);
  min-height: 420px; display: flex; flex-direction: column; overflow: hidden;
}
.ls-stage-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--ls-line); flex-wrap: wrap;
}
.ls-stage-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 28px; position: relative }

/* Section boxes */
.ls-box { border: 1px solid var(--ls-line); border-radius: 12px; padding: 12px 14px }
.ls-box-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px }
.ls-box-h b { font-size: 13px; font-weight: 600 }
.ls-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px }
.ls-field:last-child { margin-bottom: 0 }
.ls-field label, .ls-lbl {
  font-family: var(--ls-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ls-mut);
}
.ls-root input[type=text], .ls-root input[type=search], .ls-root input[type=number],
.ls-root select, .ls-hex {
  width: 100%; font: inherit; font-size: 13px; color: var(--ls-fg); background: var(--ls-bg);
  border: 1px solid var(--ls-line); border-radius: 10px; padding: 9px 12px; outline: none;
}
.ls-root input:focus, .ls-root select:focus, .ls-hex:focus { border-color: var(--ls-mut) }
.ls-root input[type=range] {
  width: 100%; padding: 0; accent-color: var(--ls-fg); background: none; border: 0; height: 28px;
}
.ls-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--ls-fg) }
.ls-chk input { width: auto; accent-color: var(--ls-fg); margin: 0 }

/* Segmented controls */
.ls-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px }
.ls-seg button, .ls-icon-pick button, .ls-swatch, .ls-btn, .ls-pill {
  font: inherit; font-size: 12px; color: var(--ls-fg); background: transparent;
  border: 1px solid var(--ls-line); border-radius: 999px; padding: 7px 10px; cursor: pointer; transition: .15s;
}
.ls-seg button:hover, .ls-btn:hover, .ls-pill:hover { border-color: var(--ls-mut) }
.ls-seg button.on, .ls-pill.on, .ls-btn.solid {
  background: var(--ls-acc); color: var(--ls-bg); border-color: var(--ls-acc);
}
.ls-btn { border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 13px }
.ls-btn.ghost { background: transparent }
.ls-btn:disabled { opacity: .4; cursor: default }
.ls-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.ls-row > * { flex: 1 }

/* Icons picker */
.ls-icon-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px }
.ls-icon-pick button {
  aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; padding: 10px;
}
.ls-icon-pick button.on { border-color: var(--ls-fg); background: var(--ls-hov) }
.ls-icon-pick svg { width: 28px; height: 28px; color: var(--ls-fg) }

/* Font list */
.ls-font-tools { display: flex; flex-direction: column; gap: 8px }
.ls-font-list {
  max-height: 180px; overflow: auto; border: 1px solid var(--ls-line); border-radius: 10px;
  display: flex; flex-direction: column;
}
.ls-font-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 9px 12px; border: 0; border-bottom: 1px solid var(--ls-line); border-radius: 0;
  background: transparent; text-align: left; cursor: pointer; color: var(--ls-fg); font: inherit;
}
.ls-font-item:last-child { border-bottom: 0 }
.ls-font-item:hover { background: var(--ls-hov) }
.ls-font-item.on { background: var(--ls-hov); box-shadow: inset 2px 0 0 var(--ls-fg) }
.ls-font-item .ls-fname { font-size: 14px; font-weight: 500 }
.ls-font-item .ls-fcat { font-family: var(--ls-mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ls-mut) }

/* Color */
.ls-colors { display: grid; gap: 10px }
.ls-color-row { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: start }
.ls-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center }
.ls-swatch {
  width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 1px solid var(--ls-line);
  position: relative;
}
.ls-swatch.on::after {
  content: ''; position: absolute; inset: -3px; border: 1.5px solid var(--ls-fg); border-radius: 50%;
}
.ls-hex-wrap { display: flex; gap: 6px; align-items: center; margin-top: 6px }
.ls-hex-wrap input[type=color] {
  width: 36px; height: 36px; padding: 0; border: 1px solid var(--ls-line); border-radius: 8px;
  background: transparent; cursor: pointer;
}
.ls-hex { font-family: var(--ls-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; flex: 1 }

/* Live compose */
.ls-compose {
  display: flex; align-items: center; justify-content: center; gap: var(--ls-gap, 16px);
  padding: 24px 32px; border-radius: 12px; min-width: min(100%, 520px); max-width: 100%;
  transition: background .2s;
}
.ls-compose[data-layout=top] { flex-direction: column }
.ls-compose[data-layout=left] { flex-direction: row }
.ls-compose[data-layout=icon] .ls-name, .ls-compose[data-layout=name] .ls-icon { display: none }
.ls-icon { display: flex; line-height: 0; flex: none }
.ls-icon svg { width: var(--ls-icon-size, 56px); height: var(--ls-icon-size, 56px); display: block }
.ls-name {
  font-size: var(--ls-name-size, 36px); font-weight: var(--ls-weight, 600);
  letter-spacing: var(--ls-tracking, 0em); line-height: 1.1; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ls-watermark {
  position: absolute; inset: 0; pointer-events: none; display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 12px 16px; font-family: var(--ls-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ls-mut); opacity: .55;
}

/* View toggle */
.ls-view-toggle { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--ls-line); border-radius: 999px }
.ls-view-toggle button { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 500; color: var(--ls-mut); cursor: pointer }
.ls-view-toggle button.on { background: var(--ls-acc); color: var(--ls-bg) }

/* Mockups */
.ls-mockups {
  display: none; width: 100%; height: 100%; padding: 16px; overflow: auto;
}
.ls-root[data-view=mockups] .ls-editor-view { display: none }
.ls-root[data-view=mockups] .ls-mockups { display: block }
.ls-root[data-view=editor] .ls-editor-view { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center }
.ls-mk-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.ls-mk-card-wrap { display: flex; flex-direction: column; gap: 8px }
.ls-mk-frame {
  aspect-ratio: 1; border: 1px solid var(--ls-line); border-radius: 12px; background: var(--ls-card);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
  padding: 16px;
}
.ls-mk-label { margin: 0; font-size: 12px; color: var(--ls-mut); display: flex; gap: 8px; align-items: center }
.ls-mk { width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center }
.ls-mk-slot {
  display: flex; align-items: center; justify-content: center;
  transform: scale(var(--ls-mk-scale, .55)); transform-origin: center;
}
.ls-mk-slot .ls-compose { padding: 0; min-width: 0; background: transparent !important }
.ls-mk-slot .ls-name { font-size: 28px }
.ls-mk-slot .ls-icon svg { width: 40px; height: 40px }

/* Card mockup */
.ls-mk-card { perspective: 800px }
.ls-mk-card-front {
  width: 86%; aspect-ratio: 1.7/1; background: #f4f2ee; color: #111; border-radius: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.4) inset;
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px 16px;
  transform: rotateY(-8deg) rotateX(4deg);
}
[data-theme=light] .ls-mk-card-front { box-shadow: 0 14px 32px rgba(0,0,0,.12) }
.ls-mk-card-front .ls-mk-slot { align-self: flex-start; transform: scale(.42); transform-origin: left center }
.ls-mk-card-meta { display: flex; flex-direction: column; gap: 5px }
.ls-mk-line {
  display: block; height: 4px; width: 70%; border-radius: 2px;
  background: currentColor; opacity: .12;
}
.ls-mk-line.short { width: 40% } .ls-mk-line.mid { width: 55% }
.ls-mk-card-meta { color: #111 }

/* Letterhead */
.ls-mk-paper {
  width: 72%; height: 90%; background: #faf8f4; color: #111; border-radius: 2px;
  box-shadow: 0 20px 44px rgba(0,0,0,.3); padding: 14px 16px; display: flex; flex-direction: column; gap: 14px;
  transform: perspective(900px) rotateY(6deg) rotateX(2deg);
}
.ls-mk-letter-head { border-bottom: 1px solid rgba(0,0,0,.08); padding-bottom: 10px }
.ls-mk-letter-head .ls-mk-slot { transform: scale(.38); transform-origin: left center; justify-content: flex-start }
.ls-mk-letter-body { display: flex; flex-direction: column; gap: 6px; color: #111; flex: 1 }

/* Shirt */
.ls-mk-shirt { --ls-mk-fab: #2c2c32; --ls-mk-fab2: #1c1c22 }
[data-theme=light] .ls-mk-shirt { --ls-mk-fab: #3a3a42; --ls-mk-fab2: #2a2a30 }
.ls-mk-shirt-svg { width: 78%; height: auto; filter: drop-shadow(0 16px 28px rgba(0,0,0,.35)) }
.ls-mk-shirt-slot {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) scale(.32);
}

/* Tote */
.ls-mk-tote { --ls-mk-tote: #e8e0d4; --ls-mk-tote2: #d2c4b0; --ls-mk-handle: #8a7a68 }
.ls-mk-tote-svg { width: 70%; height: auto; filter: drop-shadow(0 16px 28px rgba(0,0,0,.28)) }
.ls-mk-tote-slot {
  position: absolute; top: 58%; left: 50%; transform: translate(-50%, -50%) scale(.34);
}

/* Sign */
.ls-mk-sign-building {
  width: 88%; height: 88%; background: linear-gradient(180deg, #3a3a40 0%, #25252a 100%);
  border-radius: 4px 4px 0 0; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; padding-top: 10%;
}
.ls-mk-sign-board {
  width: 78%; height: 28%; background: #0e0e10; border: 2px solid #c9a227;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(201,162,39,.25), inset 0 0 20px rgba(0,0,0,.5);
}
.ls-mk-sign-board .ls-mk-slot { transform: scale(.4) }
.ls-mk-sign-board .ls-compose { filter: drop-shadow(0 0 6px rgba(255,255,255,.15)) }
.ls-mk-sign-window {
  position: absolute; bottom: 18%; left: 12%; width: 28%; height: 22%;
  background: linear-gradient(135deg, #6a8caa55, #3a506655); border: 1px solid #555;
}
.ls-mk-sign-door {
  position: absolute; bottom: 0; right: 18%; width: 18%; height: 32%;
  background: #1a1a1e; border: 1px solid #444; border-bottom: 0;
}

/* Phone */
.ls-mk-phone-bezel {
  width: 48%; max-width: 160px; aspect-ratio: 9/19; background: #121214;
  border-radius: 22px; border: 3px solid #2a2a2e; padding: 8px 6px 10px;
  box-shadow: 0 22px 44px rgba(0,0,0,.45); position: relative;
}
.ls-mk-phone-notch {
  width: 38%; height: 5px; background: #000; border-radius: 999px; margin: 0 auto 8px;
}
.ls-mk-phone-screen {
  height: calc(100% - 14px); background: var(--ls-bg); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.ls-mk-phone-banner {
  padding: 18px 10px 14px; background: color-mix(in srgb, var(--ls-card) 80%, transparent);
  border-bottom: 1px solid var(--ls-line); display: flex; justify-content: center;
}
.ls-mk-phone-banner .ls-mk-slot { transform: scale(.28) }
.ls-mk-phone-feed { padding: 10px; display: flex; flex-direction: column; gap: 6px; flex: 1 }
.ls-mk-block {
  display: block; height: 48px; border-radius: 8px; background: var(--ls-line); opacity: .5; margin: 4px 0;
}

/* Mobile drawer */
.ls-mobile-bar { display: none }
.ls-drawer-backdrop { display: none }
@media (max-width: 900px) {
  .ls-shell { grid-template-columns: 1fr; gap: 10px }
  .ls-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    max-height: min(78svh, 640px); border-radius: 16px 16px 0 0; border-bottom: 0;
    transform: translateY(110%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .ls-root.ls-drawer-open .ls-panel { transform: translateY(0) }
  .ls-drawer-backdrop {
    display: block; position: fixed; inset: 0; background: #0008; z-index: 39; opacity: 0; pointer-events: none;
    transition: opacity .25s;
  }
  .ls-root.ls-drawer-open .ls-drawer-backdrop { opacity: 1; pointer-events: auto }
  .ls-mobile-bar {
    display: flex; position: sticky; bottom: 0; z-index: 5; gap: 8px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--ls-bg) 92%, transparent); backdrop-filter: blur(10px);
  }
  .ls-mobile-bar .ls-btn { flex: 1 }
  .ls-stage { min-height: 360px; margin-bottom: 8px }
  .ls-mk-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    padding-bottom: 8px; scrollbar-width: none;
  }
  .ls-mk-grid::-webkit-scrollbar { display: none }
  .ls-mk-card-wrap { flex: 0 0 82%; scroll-snap-align: center }
  .ls-seg { grid-template-columns: repeat(2, 1fr) }
  .ls-panel-handle {
    width: 40px; height: 4px; border-radius: 2px; background: var(--ls-line); margin: 0 auto 10px;
  }
}
@media (min-width: 901px) {
  .ls-panel-handle { display: none }
}

/* Demo chrome */
.ls-demo-top {
  display: flex; justify-content: space-between; align-items: center; height: 56px;
  padding: 0 28px; border-bottom: 1px solid var(--ls-line);
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--ls-bg) 85%, transparent); backdrop-filter: blur(10px);
}
.ls-demo-top a { border: 0; font-weight: 600; color: inherit; text-decoration: none }
.ls-demo-main { padding: 20px 28px 40px; max-width: 1280px; margin: 0 auto }
.ls-demo-h { margin: 0 0 6px; font-size: clamp(24px, 4vw, 36px); letter-spacing: -.02em }
.ls-demo-lead { margin: 0 0 20px; color: var(--ls-mut); max-width: 52ch }

/* Readable logo on light mockup surfaces */
.ls-mk-card-front .ls-compose .ls-icon,
.ls-mk-card-front .ls-compose .ls-name,
.ls-mk-paper .ls-compose .ls-icon,
.ls-mk-paper .ls-compose .ls-name,
.ls-mk-tote-slot .ls-compose .ls-icon,
.ls-mk-tote-slot .ls-compose .ls-name {
  color: #111 !important;
}
.ls-mk-card-front .ls-compose .ls-icon svg,
.ls-mk-paper .ls-compose .ls-icon svg,
.ls-mk-tote-slot .ls-compose .ls-icon svg { color: #111 !important }
.ls-mk-card-front .ls-compose .ls-icon svg [fill]:not([fill='none']),
.ls-mk-paper .ls-compose .ls-icon svg [fill]:not([fill='none']),
.ls-mk-tote-slot .ls-compose .ls-icon svg [fill]:not([fill='none']) { fill: #111 !important }
.ls-mk-card-front .ls-compose .ls-icon svg [stroke]:not([stroke='none']),
.ls-mk-paper .ls-compose .ls-icon svg [stroke]:not([stroke='none']),
.ls-mk-tote-slot .ls-compose .ls-icon svg [stroke]:not([stroke='none']) { stroke: #111 !important }

/* Name wrapping / scale */
.ls-name { white-space: nowrap; max-width: min(70vw, 520px) }
.ls-compose { max-width: 100%; overflow: hidden }
@media (max-width: 900px) {
  .ls-panel { transform: translateY(calc(100% + 24px)); }
  .ls-root.ls-drawer-open .ls-panel { transform: translateY(0); }
  .ls-name { font-size: clamp(18px, 7vw, 36px) !important; max-width: 78vw }
  .ls-stage-body { padding: 16px }
  .ls-demo-main { padding: 16px 16px 32px }
  .ls-demo-top { padding: 0 16px }
}
