/* Concept Studio — app styles. Brand tokens come from ../css/brand.css. */
:root { --line: #d9d0bf; --line-2: #c9bfab; --bar-h: 60px; }
html, body { height: 100%; }
body { background: var(--paper); font-size: 15px; line-height: 1.4; overflow: hidden; }
[hidden] { display: none !important; }
#app { height: 100%; display: flex; flex-direction: column; }
.boot { margin: auto; color: var(--muted); }
h1, h2, h3, p { margin: 0; }
.grow { flex: 1; }
:focus-visible { outline: 2.5px solid var(--cobalt); outline-offset: 2px; }

/* ---------- controls ---------- */
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 99px; background: var(--white); font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; transition: transform .15s var(--ease), background .15s, color .15s, box-shadow .15s; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; pointer-events: none; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn.danger { background: #c81e3a; border-color: #c81e3a; color: #fff; }
.btn.danger:hover { background: #9d1429; }
.btn.small { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn.add { width: 100%; border-style: dashed; border-color: var(--line-2); background: transparent; color: var(--muted); }
.btn.add:hover { border-color: var(--ink); border-style: solid; background: var(--white); color: var(--ink); }
.ib { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); flex: none; }
.ib:hover { background: var(--paper-2); color: var(--ink); }
.ib .ic { width: 17px; height: 17px; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], textarea, .sel {
  width: 100%; min-height: 38px; padding: 8px 11px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--white); font-size: 14px; line-height: 1.35; transition: border-color .15s; }
textarea { resize: vertical; min-height: 64px; }
input:hover, textarea:hover, .sel:hover { border-color: var(--muted); }
input:focus, textarea:focus, .sel:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(39, 64, 255, .16); }
.sel { width: auto; padding-right: 30px; cursor: pointer; font-weight: 600; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314110f' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
.f { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; min-width: 0; }
.f .sel { width: 100%; }
.f-l { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f-l output { font-weight: 600; letter-spacing: 0; color: var(--ink); }
.f-h { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
p.f-h { margin-bottom: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chk { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; font-size: 14px; cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; margin: 0; }
input[type=range] { width: 100%; accent-color: var(--ink); margin: 2px 0; }
input[type=color] { width: 30px; height: 30px; padding: 0; border: 1.5px solid var(--line-2); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; flex: none; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-bottom: 12px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid rgba(20, 17, 15, .22); cursor: pointer; padding: 0; position: relative; }
.sw.on::after { content: ''; position: absolute; inset: -5px; border: 2px solid var(--ink); border-radius: 50%; }
.sw.auto { background: repeating-linear-gradient(45deg, var(--paper-2) 0 4px, var(--white) 4px 8px); font-size: 11px; font-weight: 800; }
.seg { display: inline-flex; padding: 3px; border-radius: 99px; background: var(--paper-2); width: fit-content; }
.seg button { border: 0; background: transparent; padding: 6px 18px; border-radius: 99px; font-weight: 650; font-size: 13.5px; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--paper); }
.upl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upl img, .upl-empty { height: 46px; min-width: 46px; max-width: 150px; object-fit: contain; border-radius: 10px; background: #fff; border: 1.5px solid var(--line); padding: 5px; }
.upl-empty { display: grid; place-items: center; font-size: 11.5px; color: var(--muted); padding: 0 10px; }
.upl-empty .logo-mark { width: 30px; height: 30px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--paper-2); }
.pill.s-sent { background: #dfe4ff; color: #1b2bb8; }
.pill.s-won { background: var(--lime); }
.pill.s-lost { background: #ecd9d4; color: #7d2a18; }

/* ---------- bar ---------- */
.bar { flex: none; height: var(--bar-h); display: flex; align-items: center; gap: 10px; padding: 0 18px; background: var(--white); border-bottom: 1.5px solid var(--line); position: relative; z-index: 5; }
.bar .logo-word { font-size: 19px; }
.bar-title { font-weight: 750; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; padding: 6px; background: var(--white); border: 1.5px solid var(--ink); border-radius: 16px; box-shadow: 0 18px 40px -12px rgba(20, 17, 15, .35); z-index: 30; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 11px; cursor: pointer; }
.menu button:hover, .menu button:focus-visible { background: var(--paper-2); }
.menu b { display: block; font-size: 14.5px; }
.menu small { color: var(--muted); font-size: 12.5px; }

/* ---------- home ---------- */
.home { flex: 1; overflow: auto; padding: 36px clamp(18px, 4vw, 56px) 64px; }
.home-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.home-head h1 { font-size: clamp(34px, 4vw, 52px); font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.home-head p { color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.search { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search .ic { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.search input { padding-left: 38px; border-radius: 99px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.none { color: var(--muted); grid-column: 1 / -1; padding: 30px 0; }
.card { background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 22px 40px -22px rgba(20, 17, 15, .45); }
.card-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-bottom: 1.5px solid var(--line); background: var(--paper-2); cursor: pointer; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-empty { color: var(--muted); font-size: 13px; }
.card-body { padding: 14px 16px 12px; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.card-date { font-size: 12.5px; color: var(--muted); }
.card h3 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.card p { color: var(--muted); font-size: 13.5px; margin: 4px 0 12px; }
.card-actions { display: flex; align-items: center; gap: 2px; }
.empty { max-width: 720px; margin: 7vh auto 0; text-align: center; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 18px; }
.empty h1 { font-size: clamp(44px, 7vw, 86px); font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.empty h1 em { font-size: 1.06em; color: var(--accent); }
.lead { font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 540px; margin: 22px auto 30px; }
.empty-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- deck editor ---------- */
.ed { flex: 1; min-height: 0; display: grid; grid-template-columns: 212px minmax(0, 1fr) 348px; }
.rail { overflow-y: auto; padding: 14px 12px 40px; border-right: 1.5px solid var(--line); background: var(--paper-2); display: flex; flex-direction: column; gap: 12px; }
.rail-thumb { display: block; position: relative; width: 100%; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--paper-3); cursor: pointer; box-shadow: 0 1px 0 rgba(20, 17, 15, .12); transition: border-color .15s, transform .2s var(--ease); }
.rail-thumb canvas { width: 100%; display: block; aspect-ratio: 16 / 9; }
.rail-item:hover .rail-thumb { transform: scale(1.015); }
.rail-item.on .rail-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 74, 28, .2); }
.rail-off { display: none; position: absolute; inset: 0; place-items: center; font-size: 11.5px; font-weight: 600; color: var(--muted); background: repeating-linear-gradient(45deg, var(--paper-2) 0 7px, var(--paper) 7px 14px); }
.rail-item.off .rail-off { display: grid; }
.rail-label { display: flex; align-items: center; justify-content: space-between; min-height: 26px; margin-top: 3px; padding: 0 2px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.rail-label > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-tools { display: none; flex: none; }
.rail-item:hover .rail-tools, .rail-item:focus-within .rail-tools { display: flex; }
.rail-tools .ib { width: 23px; height: 23px; }
.rail-tools .ib .ic { width: 14px; height: 14px; }
.stage { min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 26px 30px 18px; gap: 16px; overflow: auto; }
.preview-wrap { width: 100%; max-width: calc((100vh - 190px) * 16 / 9); }
.preview { width: 100%; height: auto; border-radius: 12px; box-shadow: 0 2px 0 rgba(20, 17, 15, .08), 0 30px 60px -30px rgba(20, 17, 15, .5); background: var(--white); }
.preview.can-edit { cursor: pointer; }
.preview-note { aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 30px; text-align: center; border: 2px dashed var(--line-2); border-radius: 12px; color: var(--muted); font-size: 16px; }
.stage-tools { display: flex; align-items: center; gap: 14px; min-height: 38px; flex-wrap: wrap; justify-content: center; }
.stage-hint { color: var(--muted); font-size: 13.5px; }
.panel { overflow-y: auto; padding: 22px 20px 60px; border-left: 1.5px solid var(--line); background: var(--white); }
.panel h2, .modal h2 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 16px; }
.panel h3, .mk-side h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; margin: 22px 0 11px; padding-top: 16px; border-top: 1.5px solid var(--line); }
.mk-side h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- modal, toast ---------- */
.ov { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(20, 17, 15, .5); animation: fade .18s; }
.modal { width: min(460px, 100%); max-height: 92vh; overflow: auto; padding: 26px; border-radius: 22px; background: var(--white); border: 1.5px solid var(--ink); box-shadow: 0 40px 80px -30px rgba(20, 17, 15, .6); animation: pop .26s var(--ease); }
.modal p { color: var(--ink-2); line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 90; transform: translate(-50%, 30px); padding: 11px 20px; border-radius: 99px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: transform .3s var(--ease), opacity .3s; max-width: 90vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #c81e3a; color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------- mockup editor ---------- */
.mk { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: var(--paper); animation: fade .16s; }
.mk-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; }
.mk-side { overflow-y: auto; padding: 20px 18px 50px; background: var(--white); }
.mk-side:first-child { border-right: 1.5px solid var(--line); }
.mk-side:last-child { border-left: 1.5px solid var(--line); }
.mk-note { font-size: 12.5px; color: var(--muted); margin: 9px 0 13px; line-height: 1.4; }
.mk-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; min-width: 0; overflow: hidden; }
.mk-stage { position: relative; width: min(100%, calc(100vh - 200px)); aspect-ratio: 1; border-radius: 20px; background: #e8e0d0; box-shadow: 0 2px 0 rgba(20, 17, 15, .08), 0 30px 60px -34px rgba(20, 17, 15, .5); touch-action: none; user-select: none; overflow: hidden; cursor: default; }
.mk-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.mk-sel { position: absolute; left: 0; top: 0; transform-origin: center; border: 1.5px solid var(--cobalt); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); cursor: move; }
.mk-sel.is-area { border: 2px dashed var(--accent); background: rgba(255, 74, 28, .07); }
.hd { position: absolute; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 2px solid var(--cobalt); }
.hd.nw { left: -7px; top: -7px; cursor: nwse-resize; }
.hd.ne { right: -7px; top: -7px; cursor: nesw-resize; }
.hd.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.hd.sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.hd.rot { left: 50%; top: -30px; margin-left: -7px; cursor: grab; background: var(--cobalt); }
.hd.rot::after { content: ''; position: absolute; left: 3.5px; top: 11px; width: 1.5px; height: 17px; background: var(--cobalt); }
.mk-sel.is-area .hd { border-color: var(--accent); border-radius: 3px; }
.mk-sel.is-area .hd.rot { display: none; }
.mk-guide { position: absolute; background: var(--pink); pointer-events: none; }
.mk-guide.v { top: 0; bottom: 0; width: 1.5px; }
.mk-guide.h { left: 0; right: 0; height: 1.5px; }
.mk-warn { padding: 7px 14px; border-radius: 99px; background: #ffe2a8; font-size: 13px; font-weight: 650; visibility: hidden; }
.mk-warn.on { visibility: visible; }
.mk-hint { font-size: 12.5px; color: var(--muted); text-align: center; max-width: 560px; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.prod { padding: 4px 2px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; font-size: 11px; font-weight: 600; line-height: 1.15; transition: border-color .15s, transform .15s var(--ease); }
.prod img { width: 100%; aspect-ratio: 1; }
.prod:hover { border-color: var(--ink); transform: translateY(-2px); }
.prod.on { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(255, 74, 28, .18); }
.layers { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.layer { display: flex; align-items: center; gap: 1px; padding: 4px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); margin-bottom: 10px; }
.layers .layer { margin-bottom: 0; }
.layer.on { border-color: var(--cobalt); background: #eef0ff; }
.layer-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 2px 4px; cursor: pointer; text-align: left; font-size: 13.5px; font-weight: 600; }
.layer-main span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-main img, .layer-t { width: 34px; height: 34px; flex: none; border-radius: 7px; background: repeating-conic-gradient(#e9e3d6 0 25%, #fff 0 50%) 0 0 / 10px 10px; object-fit: contain; display: grid; place-items: center; font-weight: 800; font-family: var(--font-serif); font-size: 20px; }
.layer-t.dash { background: none; border: 2px dashed var(--accent); }
.layer .ib { width: 25px; height: 25px; }
.layer .ib .ic { width: 15px; height: 15px; }
.props { margin-top: 16px; padding: 14px 14px 4px; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--line); }
.props h3 { margin: 0 0 12px; padding: 0; border: 0; }
.tint { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tint input[type=color] { margin-bottom: 11px; }

/* ---------- presenter ---------- */
.present { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: #0b0a09; cursor: pointer; }
.present canvas { display: block; }
.pr-bar { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 99px; background: rgba(20, 17, 15, .78); color: var(--paper); opacity: .2; transition: opacity .2s; cursor: default; }
.pr-bar:hover, .pr-bar:focus-within { opacity: 1; }
.pr-bar .ib { color: var(--paper); }
.pr-bar .ib:hover { background: rgba(245, 240, 230, .18); color: #fff; }
.pr-count { font-size: 13px; font-weight: 600; min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 160px minmax(0, 1fr) 300px; }
  .mk-body { grid-template-columns: 240px minmax(0, 1fr) 280px; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100%; }
  .bar { height: auto; min-height: var(--bar-h); flex-wrap: wrap; padding: 8px 12px; }
  .ed { display: flex; flex-direction: column; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1.5px solid var(--line); padding: 10px; }
  .rail-item { flex: none; width: 130px; }
  .rail .btn.add { width: auto; flex: none; align-self: center; }
  .stage { padding: 16px 12px; overflow: visible; }
  .preview-wrap { max-width: none; }
  .panel { border-left: 0; border-top: 1.5px solid var(--line); }
  .mk { position: absolute; min-height: 100%; bottom: auto; }
  .mk-body { display: flex; flex-direction: column; }
  .mk-center { order: -1; }
  .mk-stage { width: min(100%, 520px); }
  .mk-side { border: 0 !important; border-top: 1.5px solid var(--line) !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
