/* Wah-Kit picture designer (/design/) */
.ds-intro { padding: 18px 0 12px; }
.ds-intro h1 { font-size: clamp(24px, 3.4vw, 32px); }
.ds-intro p { margin: 4px 0 0; }
.how { margin-top: 26px; max-width: 860px; color: var(--ink-soft); }
.how h2 { font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.how ol { padding-left: 22px; margin: 0; }
.how li { margin: 4px 0; }

.ds > * { min-width: 0; }
.ds { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.ds-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: sticky; top: 10px; }
.ds-board { position: relative; box-shadow: 0 4px 22px rgba(29,26,57,.16); border-radius: 4px; overflow: visible; }
.ds-canvas { display: block; width: 100%; height: 100%; border-radius: 4px; background: #fff; }
.ds-overlay { position: absolute; inset: 0; touch-action: none; cursor: default; user-select: none; -webkit-user-select: none; }
.ds-frame { position: absolute; border: 2px solid #1F5FD1; box-shadow: 0 0 0 1px rgba(255,255,255,.8); border-radius: 2px; cursor: move; pointer-events: none; }
.ds-frame > * { pointer-events: auto; }
.ds-hd { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid #1F5FD1; border-radius: 50%; touch-action: none; }
.ds-hd::after { content: ''; position: absolute; inset: -12px; }          /* bigger finger target */
.ds-hd.tl { left: -9px; top: -9px; cursor: nwse-resize; } .ds-hd.tr { right: -9px; top: -9px; cursor: nesw-resize; }
.ds-hd.bl { left: -9px; bottom: -9px; cursor: nesw-resize; } .ds-hd.br { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ds-hd.mr, .ds-hd.ml { width: 10px; height: 26px; border-radius: 6px; top: 50%; margin-top: -13px; cursor: ew-resize; }
.ds-hd.mr { right: -7px; } .ds-hd.ml { left: -7px; }
.ds-hd.mb { width: 26px; height: 10px; border-radius: 6px; left: 50%; margin-left: -13px; bottom: -7px; cursor: ns-resize; }
.ds-frame[data-t="sticker"] .ds-hd.mr, .ds-frame[data-t="sticker"] .ds-hd.ml, .ds-frame[data-t="sticker"] .ds-hd.mb,
.ds-frame[data-t="emoji"] .ds-hd.mr, .ds-frame[data-t="emoji"] .ds-hd.ml, .ds-frame[data-t="emoji"] .ds-hd.mb,
.ds-frame[data-t="qr"] .ds-hd.mr, .ds-frame[data-t="qr"] .ds-hd.ml, .ds-frame[data-t="qr"] .ds-hd.mb,
.ds-frame[data-t="text"] .ds-hd.mb { display: none; }
.ds-rot { position: absolute; left: 50%; top: -44px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: #1F5FD1; color: #fff; display: grid; place-items: center; font-size: 17px; cursor: grab; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ds-rot::before { content: ''; position: absolute; left: 50%; top: 30px; width: 2px; height: 12px; background: #1F5FD1; }
.ds-rot::after { content: ''; position: absolute; inset: -10px; }
.ds-x { position: absolute; right: -15px; top: -44px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #C23A14; color: #fff; font-size: 15px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ds-guide { position: absolute; background: #FF2D87; pointer-events: none; }
.ds-guide.v { left: 50%; top: 0; bottom: 0; width: 1px; } .ds-guide.h { top: 50%; left: 0; right: 0; height: 1px; }

.ds-bar { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.ds-sp { flex: 1; }
.ds-icon { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 20px; cursor: pointer; color: var(--ink); }
.ds-icon:disabled { opacity: .35; cursor: default; }
.ds-sizelbl { font-size: 13px; font-weight: 700; color: var(--muted); }
.ds-go, .ds-go2 { min-height: 42px; }

.ds-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 0 12px; max-height: calc(100vh - 20px); overflow-y: auto; position: sticky; top: 10px; }
.ds-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.ds-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 10px; background: none; font: 600 11.5px var(--font-body); color: var(--ink-soft); cursor: pointer; }
.ds-tabs button .ti { font-size: 19px; line-height: 1.1; }
.ds-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); }
.ds-panel { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 12px; }
.ds-h { font-size: 16px; margin: 0; color: var(--ink); }
.ds-hint { font-size: 13px; color: var(--muted); margin: 0; }
.ds-note { margin: 10px 14px 0; font-size: 14px; color: #A3140F; min-height: 0; }
.ds-note.ok { color: #0F6B3E; }
.ds-note:empty { display: none; }
.ds-marknote { margin: 10px 14px 0; }
.ds-f { display: flex; flex-direction: column; gap: 6px; }
.ds-f.inline { flex-direction: row; align-items: center; }
.ds-fl { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.ds-f select, .ds-f input[type=text] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font: 15px var(--font-body); background: var(--surface); color: var(--ink); min-width: 0; flex: 1; }
.ds-ta { width: 100%; box-sizing: border-box; border: 2px solid #1F5FD1; border-radius: 12px; padding: 10px 12px; font: 17px var(--font-body); resize: vertical; min-height: 76px; color: var(--ink); }
.ds-row { display: flex; gap: 8px; align-items: center; }
.ds-row.wrap { flex-wrap: wrap; }
.ds-tk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ds-btn { min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); font: 700 14px var(--font-body); color: var(--ink); cursor: pointer; padding: 6px 10px; }
.ds-btn:hover { border-color: #b9b8cc; }
.ds-mini { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: 700 13px var(--font-body); color: var(--ink); cursor: pointer; }
.ds-mini.danger { color: #A3140F; }
.ds-ihead { display: flex; justify-content: space-between; align-items: center; }
.ds-ihead b { font-size: 16px; }
.ds-arr { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 4px; border-top: 1px solid var(--line); }

.ds-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-sw button, .ds-more { width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; position: relative; }
.ds-sw button[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1F5FD1; }
.ds-sw button.none { background: linear-gradient(135deg, #fff 45%, #E63946 45%, #E63946 55%, #fff 55%); }
.ds-more { display: grid; place-items: center; background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e); overflow: hidden; }
.ds-more span { color: #fff; font-weight: 800; text-shadow: 0 0 3px rgba(0,0,0,.6); pointer-events: none; }
.ds-more input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.ds-slider { display: flex; align-items: center; gap: 10px; }
.ds-slider input { flex: 1; accent-color: #1F5FD1; }
.ds-slider output { min-width: 44px; text-align: right; font-size: 13px; color: var(--ink-soft); }
.ds-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--ground); }
.ds-seg button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 9px; background: none; font: 700 13px var(--font-body); color: var(--ink-soft); cursor: pointer; }
.ds-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(29,26,57,.15); }
.ds-check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); cursor: pointer; }
.ds-check input { width: 18px; height: 18px; }

.ds-grads { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.ds-grads button { aspect-ratio: 1; border-radius: 8px; border: 1px solid rgba(0,0,0,.12); cursor: pointer; }
.ds-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ds-style { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: 600 12px var(--font-body); color: var(--ink-soft); }
.ds-style canvas { width: 100%; height: auto; border-radius: 6px; display: block; background: #eee; }
.ds-style:hover { border-color: #1F5FD1; }
.ds-sizes { display: flex; flex-direction: column; gap: 8px; }
.ds-size { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; align-items: center; }
.ds-size[aria-pressed="true"] { border: 2px solid #1F5FD1; background: #F2F6FF; }
.ds-size .shape { grid-row: span 2; justify-self: center; border: 2px solid var(--ink-soft); border-radius: 3px; }
.ds-size .shape.square { width: 30px; height: 30px; } .ds-size .shape.portrait { width: 26px; height: 32px; }
.ds-size .shape.story { width: 20px; height: 36px; } .ds-size .shape.wide { width: 38px; height: 22px; }
.ds-size b { font-size: 15px; color: var(--ink); } .ds-size small { font-size: 12.5px; color: var(--muted); }
.ds-stk { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ds-stk button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--ground); cursor: pointer; padding: 6px; }
.ds-stk img { width: 100%; height: 100%; object-fit: contain; }
.ds-stk.small { grid-template-columns: repeat(7, 1fr); }
.ds-emo { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.ds-emo button { aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 24px; cursor: pointer; padding: 0; }
.ds-emo button:hover { background: var(--ground); }
.ds-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ds-fonts button { min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 17px; color: var(--ink); cursor: pointer; padding: 4px 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ds-fonts button[aria-pressed="true"] { border: 2px solid #1F5FD1; background: #F2F6FF; }
.ds-mine { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ds-m { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.ds-m.on { border: 2px solid #1F5FD1; }
.ds-m .th { border: 0; padding: 0; background: #eee; border-radius: 8px; overflow: hidden; cursor: pointer; }
.ds-m .th img { width: 100%; display: block; }
.ds-m input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font: 13px var(--font-body); min-width: 0; }
.ds-m .ds-mini { min-height: 30px; padding: 0 8px; font-size: 12px; }

/* phones and small tablets: the picture stays at the top while the tools scroll under it */
@media (max-width: 899px) {
  .ds { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ds-intro p { display: none; } .ds-intro { padding: 10px 0 6px; }
  .ds-stage { top: 0; z-index: 5; padding: 8px; overflow: hidden; border-radius: 0 0 var(--radius) var(--radius); margin: 0 -16px; border-left: 0; border-right: 0; border-top: 0; box-shadow: 0 6px 14px rgba(29,26,57,.08); }
  .ds-side { max-height: none; overflow: visible; position: static; }
  .ds-tabs { display: flex; overflow-x: auto; scrollbar-width: none; top: auto; position: static; }
  .ds-tabs::-webkit-scrollbar { display: none; }
  .ds-tabs button { flex: 0 0 auto; min-width: 66px; }
  .ds-bar { gap: 6px; flex-wrap: nowrap; }
  .ds-sizelbl { display: none; }
  .ds-go { padding: 0 14px; } .ds-go2 { padding: 0 10px; }
  .ds-icon { width: 40px; height: 40px; }
  .ds-styles { grid-template-columns: repeat(3, 1fr); }
  .ds-grads { grid-template-columns: repeat(10, 1fr); }
  .ds.typing .ds-bar { display: none; }
}
