/* The top of the 調整 drawer (index.html #drawerR, filled by ui/edit.js). It does not scroll; the sliders under it do. At the left a column: the
   title, the flower's name and its two lengths, and under them the buttons (複製 and 刪除 for the flower picked, ui/edit.js; 以目前這一面為正面 and
   恢復原本正面 for the work's front, ui/front.js). At the right the live picture (ui/preview.js), a square from the top of the drawer as wide as the
   room allows, leaving 100px for the left column (and 12px between), no wider than 30svh (a phone on its side must keep room for the sliders)
   and than 220px. The close button lies on the picture's corner. From 1024px the picture is not shown (index.html, the desktop workspace): the
   words are one row and the buttons one row under it. */
.adjust-top{position:relative;flex:none;display:flex;align-items:flex-start;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line)}
.adjust-side{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:8px}
.adjust-info h2{display:block;margin:0;font-family:var(--display);font-size:20px;line-height:1.4;letter-spacing:.04em;color:var(--ink);font-weight:700}
.adjust-name{margin:2px 0 0;font-family:var(--display);font-size:16px;line-height:1.35;font-weight:700;overflow-wrap:anywhere;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}
.adjust-len{margin:6px 0 0;font-size:13px;line-height:1.5;color:var(--muted);font-variant-numeric:tabular-nums}
.adjust-len span{display:block}
.adjust-len b{color:var(--ink);font-weight:700}
.adjust-name:empty,.adjust-len:empty{display:none}
/* In the 100px column 複製 and 刪除 stand side by side and each of the other two takes a line (they are wider than the column); where the
   column is wider they run on from one another. 以目前這一面為正面 is aria-disabled, not disabled, while it is off (ui/front.js): faded the way
   a disabled button is, but still focusable and pressable. 恢復原本正面 keeps its place while it is away (visibility, not hidden), so nothing
   moves when it comes; on a phone it takes no room (below). A piece of 滿天星 (ui/edit.js syncActs) has 複製 off and a longer word for 刪除,
   which then takes a line. */
.adjust-acts{display:flex;flex-wrap:wrap;gap:6px}
.adjust-acts .btn{flex:1 1 auto;min-height:32px;padding:4px 8px;font-size:12px;line-height:1.3;white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
.adjust-acts [data-act]{flex-basis:42px}
.adjust-acts.is-piece [data-act="del"]{flex-basis:auto}
.adjust-acts .btn[aria-disabled="true"]{opacity:.4;cursor:default}
.adjust-acts .btn:disabled:hover,.adjust-acts .btn[aria-disabled="true"]:hover{border-color:var(--line)}
.adjust-acts .is-away{visibility:hidden}
/* a phone's drawer lets go of the stage at each press of the two front buttons (ui/front.js), so no one sees the drawer move when 恢復原本正面
   comes or goes: there it takes no room while it is away. 700px is ui/drawers.js narrow() */
@media(max-width:700px){.adjust-acts .is-away{display:none}}
#drawerR .preview{flex:none;width:min(30svh,220px,calc(100% - 112px))}
#drawerR .preview canvas{display:block;width:100%;height:auto;aspect-ratio:1/1;border-radius:12px;background:var(--stage)}
.adjust-top .ibtn{position:absolute;top:14px;right:20px;background:var(--surface);background:color-mix(in srgb,var(--surface) 70%,transparent)}
/* what is said about the lengths ("接近…", "太短了…") heads the scrolling part, the width of the drawer */
#lenNote:empty{display:none}
/* a phone on its side has no height to spare: the words and the buttons stand side by side instead of one over the other */
@media(max-height:520px) and (max-width:1023px){
 .adjust-side{flex-direction:row;gap:12px}
 .adjust-info{flex:none;width:100px}
 .adjust-acts{flex:1 1 0;min-width:0;align-content:flex-start}
}
@media(min-width:1024px){
 .adjust-top .ibtn{top:10px;right:12px}
 .adjust-side{gap:12px}
 .adjust-info{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 14px;padding-right:44px}
 .adjust-name{margin:0}
 .adjust-len{display:flex;gap:12px;margin:0}
 .adjust-acts .btn{flex:0 0 auto;padding:4px 10px}
}
/* The 場景 panel (ui/appearance.js): the wall and the table as swatches. Wider than a phone (701px and up), or on a phone on its side
   (540px high or less), it floats at the foot of the stage, left of the tool column, and nothing moves. On a phone standing up it stands above the bottom bar, the full width, and the stage gives up
   the room it takes (body.scene-open, --scene-h is its height): the canvas gets smaller and frames the work again, so the panel never
   covers the vase. The swatches share the row, 9 of them, so none is out of reach and the fold button stays where it is. */
.scene-panel{position:absolute;right:calc(var(--gxr) + 62px);bottom:calc(var(--botbar) + env(safe-area-inset-bottom,0px) + 40px);width:372px;box-sizing:border-box;padding:10px 12px;display:grid;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:0 4px 16px rgba(0,0,0,.12);z-index:14}
.scene-head{display:flex;align-items:center;gap:8px;font:500 13px var(--body);color:var(--ink)}
.scene-head strong{font-weight:500}
.scene-head span{flex:1;min-width:0;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scene-head .ibtn{width:32px;height:32px;padding:0;flex-shrink:0}
.scene-row{display:flex;align-items:center;gap:8px;min-width:0}
.scene-label{width:30px;flex-shrink:0;font:500 12px var(--body);color:var(--muted)}
.scene-swatches{display:flex;gap:5px;flex:1;min-width:0}
.scene-swatches button{flex:0 1 30px;min-width:0;aspect-ratio:1;padding:0;border:1px solid rgba(128,128,128,.45);border-radius:50%;cursor:pointer}
.scene-swatches button[aria-pressed="true"]{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--accent)}
@media(max-width:700px) and (min-height:541px){
 .scene-panel{left:0;right:0;width:auto;bottom:calc(var(--botbar) + env(safe-area-inset-bottom,0px));padding:10px max(14px,env(safe-area-inset-right,0px)) 10px max(14px,env(safe-area-inset-left,0px));gap:7px;border-width:1px 0 0;border-radius:16px 16px 0 0;box-shadow:0 -3px 12px rgba(0,0,0,.08)}
 .scene-swatches button{flex-basis:32px}
 .scene-open #stage{bottom:calc(var(--botbar) + env(safe-area-inset-bottom,0px) + var(--scene-h,130px))}
}
/* a phone on its side (workspace.css: the tools stand in two columns, 109px wide): the panel floats beside both columns, so it covers no tool,
   whatever the width */
@media(max-height:540px){.scene-panel{right:calc(var(--gxr) + 122px)}}
/* The 顏色 field of the 調整 drawer (ui/colorField.js). The flower's own swatches are index.html's .swatches and .sw; 我的顏色 is a second
   row of the same with ＋ (the custom panel) and 整理 (delete) at its end. A swatch is 30px, ＋ and 整理 are 40px high, for a finger. */
#colorField .swatches{align-items:center}
#colorField .sw:disabled,#colorField .sw[aria-disabled="true"]{opacity:.4;cursor:default}
/* 目前的顏色: the flower's colour when it is in neither row; a dashed edge tells it from a kept one */
#colorField .sw.now{border:2px dashed var(--ink)}
/* 整理: a cross on each kept swatch, which a tap deletes */
#colorField .sw.del{position:relative;overflow:visible}
#colorField .sw.del::after{content:"×";position:absolute;top:-7px;right:-7px;width:18px;height:18px;border-radius:50%;background:var(--ink);color:var(--surface);font:700 13px/18px var(--body);text-align:center;pointer-events:none}
#colorField .cp-add{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:40px;min-height:40px;padding:0 11px;border:1px dashed var(--muted);border-radius:20px;background:none;color:var(--ink);font:500 13px var(--body);cursor:pointer}
#colorField .cp-add b{font:500 20px/1 var(--body)}
#colorField .cp-add:hover,#colorField .cp-add[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
#colorField .cp-tidy{min-height:40px;padding:0 10px;border:0;background:none;color:var(--accent);font:500 13px var(--body);cursor:pointer}
#colorField .cp-add:disabled,#colorField .cp-tidy:disabled{opacity:.4;cursor:default}

/* the custom panel, under the rows: the switch between the two ways to choose (below), then the colour map and the 鮮豔 slider, or three
   native sliders whose tracks are drawn as what they make (the hue always the whole circle; the other two follow the sliders' numbers,
   which ui/colorField.js keeps in --cp-h, --cp-s and --cp-l), and a dot of the colour made */
#colorField .cp{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px 12px;margin-top:6px;padding:10px 12px;border-radius:10px;background:var(--bg)}
#colorField .cp-sliders{display:grid;gap:2px}
#colorField .cp-row{display:grid;grid-template-columns:2.7em minmax(0,1fr);align-items:center;gap:6px}
#colorField .cp-dot{width:44px;height:44px;border-radius:50%;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line)}
#colorField .cp-actions{grid-column:1/-1;display:flex;gap:8px}
#colorField .cp-actions .btn{min-height:40px;padding:0 16px}
#colorField .cp-range{-webkit-appearance:none;appearance:none;display:block;grid-column:auto;width:100%;height:30px;margin:0;padding:0;background:transparent;cursor:pointer}
#colorField .cp-range[data-k="h"]{--cp-track:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)}
#colorField .cp-range[data-k="s"]{--cp-track:linear-gradient(90deg,hsl(var(--cp-h) 0% var(--cp-l)),hsl(var(--cp-h) 100% var(--cp-l)))}
#colorField .cp-range[data-k="l"]{--cp-track:linear-gradient(90deg,#000,hsl(var(--cp-h) var(--cp-s) 50%),#fff)}
#colorField .cp-range::-webkit-slider-runnable-track{height:14px;border-radius:7px;background:var(--cp-track);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}
#colorField .cp-range::-moz-range-track{height:14px;border-radius:7px;background:var(--cp-track);box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}
#colorField .cp-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;box-sizing:border-box;width:26px;height:26px;margin-top:-6px;border:3px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 0 1px rgba(0,0,0,.4),0 1px 4px rgba(0,0,0,.35)}
#colorField .cp-range::-moz-range-thumb{box-sizing:border-box;width:26px;height:26px;border:3px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 0 1px rgba(0,0,0,.4),0 1px 4px rgba(0,0,0,.35)}

/* the two ways to choose, 色彩地圖 and 滑桿: index.html's .seg in two cells, its track the lighter colour so it shows on the panel */
#colorField .cp-modes{grid-column:1/-1;grid-template-columns:repeat(2,minmax(0,1fr));background:var(--surface)}
#colorField .cp-modes button{min-height:40px}
#colorField .cp-modes button[aria-pressed="true"]{background:var(--accent);color:var(--accent-ink);box-shadow:none}
/* the colour map: a canvas the width of the panel, painted by ui/colorField.js at the device's pixels, the hue across and the lightness
   down. touch-action:none, so a finger dragging on it does not scroll the drawer. The ring is the colour now; its centre is the place
   (--cp-x and --cp-y), at the edge when the colour is past it. A fixed height, not an aspect ratio. */
#colorField .cp-mapbox{grid-column:1/-1;position:relative;min-width:0;border-radius:10px;box-shadow:0 0 0 1px rgba(0,0,0,.14)}
#colorField .cp-map{display:block;width:100%;height:140px;border-radius:10px;cursor:crosshair;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
#colorField .cp-map:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
#colorField .cp-pin{position:absolute;left:var(--cp-x);top:var(--cp-y);width:22px;height:22px;margin:-11px 0 0 -11px;box-sizing:border-box;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 1px rgba(0,0,0,.4),0 1px 4px rgba(0,0,0,.35);pointer-events:none}
@media(min-width:701px){#colorField .cp-map{height:160px}}
