/* Architect: boxes on a canvas, painted where they were drawn. Builds on
   nikhaar.css (the page frame, panel and gold button) with its own board:
   the canvas size on top, two icon strips that open and shut together (box
   kinds down the canvas's left side, canvas actions across its top), a cream
   canvas sized to fit the screen, colour-coded boxes you draw and type into,
   and a right-click menu. Phone: the kinds strip floats over the canvas,
   panel under it, the Paint button pinned. */

.ar-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.ar-head .nk-sub i { font-family: 'Playfair Display', serif; font-style: italic; color: var(--im-gold, #d8a35e); }
.ar-lead { margin: 0; max-width: 420px; font-size: 0.86rem; line-height: 1.5; color: rgba(244,233,228,0.6); }

.ar-layout { grid-template-columns: minmax(0, 1fr) 340px; }

/* The board: everything is as wide as the canvas (--ar-w, set by the script), the kinds strip hangs off its left. */
.ar-stage-wrap { min-width: 0; }
.ar-page .ar-stage-wrap { padding: 0; }   /* the shell pads a tool's stage (80px / 30px); the board takes the whole column */
.ar-board { width: var(--ar-w, 100%); max-width: 100%; margin: 0 auto; padding-left: 58px; box-sizing: content-box; }
.ar-board > * { width: var(--ar-w, 100%); max-width: 100%; }
.ar-topline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ar-strips-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; flex: none;
  border: 1px solid var(--im-border, rgba(216,163,94,0.14)); background: rgba(42,18,28,0.55); color: rgba(244,233,228,0.8); cursor: pointer; }
.ar-strips-btn svg { width: 18px; height: 18px; }
.ar-strips-btn:hover { border-color: rgba(216,163,94,0.4); }
.ar-board:not(.strips-off) .ar-strips-btn { border-color: var(--im-gold, #d8a35e); color: var(--im-gold-hi, #e9c08a); }
.ar-size { display: inline-flex; align-items: center; gap: 8px; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(244,233,228,0.5); }
.ar-size select { min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14));
  background: rgba(42,18,28,0.55); color: var(--im-text, #f4e9e4); font: inherit; font-size: 0.86rem; letter-spacing: 0; text-transform: none; }

/* Horizontal strip: canvas actions. */
.ar-actions { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; padding: 5px; border-radius: 12px; box-sizing: border-box;
  background: rgba(14,10,12,0.6); border: 1px solid rgba(255,255,255,0.07); overflow-x: auto; scrollbar-width: none; }
.ar-act { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: 9px; border: 0; background: transparent; color: rgba(244,233,228,0.75); font: inherit; font-size: 0.82rem; cursor: pointer; }
.ar-act svg { width: 18px; height: 18px; }
.ar-act:hover:not(:disabled) { background: rgba(255,255,255,0.07); color: #fff; }
.ar-act:disabled { opacity: 0.35; cursor: default; }
.ar-act .ar-off-line { display: none; }
.ar-act.is-off { color: #b48cff; } .ar-act.is-off .ar-off-line { display: inline; }
.ar-act-sep { width: 1px; height: 22px; margin: 0 4px; background: rgba(255,255,255,0.1); flex: none; }
.ar-act--gold { margin-left: auto; padding: 0 12px; border: 1px solid var(--im-gold, #d8a35e); background: rgba(216,163,94,0.1); color: var(--im-gold-hi, #e9c08a); font-weight: 600; }
.ar-act--gold small { font-size: 0.7rem; font-weight: 500; opacity: 0.75; }
.ar-act--gold small:not(:empty)::before { content: '· '; }
.ar-act.is-busy { opacity: 0.7; cursor: progress; }
.ar-opacity { display: inline-flex; align-items: center; height: 36px; padding: 0 6px; flex: none; }
.ar-opacity[hidden] { display: none; }
.ar-opacity input { width: 96px; accent-color: #d8a35e; }

/* Vertical strip: the next box's kind. */
.ar-canvas-wrap { position: relative; }
.ar-tools { position: absolute; top: 0; right: calc(100% + 10px); display: flex; flex-direction: column; gap: 4px; padding: 5px;
  border-radius: 12px; background: rgba(14,10,12,0.6); border: 1px solid rgba(255,255,255,0.07); }
.ar-tool { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border-radius: 9px;
  border: 1px solid transparent; background: transparent; cursor: pointer; }
.ar-tool svg { width: 19px; height: 19px; }
.ar-tool[data-kind="text"] { color: #f2c14e; } .ar-tool[data-kind="thing"] { color: #4fd1c5; }
.ar-tool[data-kind="person"] { color: #ff6b6b; } .ar-tool[data-kind="image"] { color: #b48cff; }
.ar-tool:hover { background: rgba(255,255,255,0.07); }
.ar-tool.is-on { background: rgba(255,255,255,0.1); border-color: currentColor; }
.ar-tool.is-armed { background: rgba(216,163,94,0.22); }
.ar-board.strips-off .ar-actions, .ar-board.strips-off .ar-tools { display: none; }

/* Canvas */
.ar-canvas { position: relative; width: 100%; max-width: 100%; aspect-ratio: var(--ar-aspect, 4 / 5); cursor: crosshair;
  border-radius: 14px; overflow: hidden; background: #f6efe4; box-shadow: 0 30px 60px rgba(0,0,0,0.45); touch-action: none; user-select: none;
  background-image: linear-gradient(#e9dfd0 1px, transparent 1px), linear-gradient(90deg, #e9dfd0 1px, transparent 1px); background-size: 10% 8%; }
.ar-canvas.has-result { background-image: none; cursor: default; }
.ar-canvas.has-result.is-armed { cursor: crosshair; }
.ar-rubber { position: absolute; box-sizing: border-box; border: 2px dashed; border-radius: 6px; pointer-events: none; }
.ar-rubber.ar-box--text { border-color: #c9961f; background: rgba(242,193,78,0.16); }
.ar-rubber.ar-box--thing { border-color: #1fa39a; background: rgba(79,209,197,0.16); }
.ar-rubber.ar-box--person { border-color: #e04f4f; background: rgba(255,107,107,0.16); }
.ar-rubber.ar-box--image { border-color: #8a5cf6; background: rgba(180,140,255,0.18); }
.ar-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-boxes { position: absolute; inset: 0; }
.ar-canvas.boxes-off .ar-boxes { display: none; }
.ar-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; width: 80%; text-align: center;
  font-size: 0.95rem; line-height: 1.5; color: #8a7a62; pointer-events: none; }
.ar-empty small { font-size: 0.78rem; color: #a89a84; }

.ar-box { position: absolute; box-sizing: border-box; border: 2px dashed; border-radius: 6px; touch-action: none; }
.ar-box--text { border-color: #c9961f; background: rgba(242,193,78,0.16); }
.ar-box--thing { border-color: #1fa39a; background: rgba(79,209,197,0.16); }
.ar-box--person { border-color: #e04f4f; background: rgba(255,107,107,0.16); }
.ar-box--image { border-color: #8a5cf6; background: rgba(180,140,255,0.18); }
.ar-canvas.has-result .ar-box { background: transparent; border-style: dashed; }
.ar-box.is-on { outline: 3px solid #8a5cf6; outline-offset: 3px; }
.ar-box-tag { position: absolute; left: -2px; top: -22px; padding: 2px 8px; border-radius: 6px 6px 0 0; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: move; }
.ar-box--text .ar-box-tag { background: #f2c14e; color: #2b2000; } .ar-box--thing .ar-box-tag { background: #4fd1c5; color: #062a27; }
.ar-box--person .ar-box-tag { background: #ff6b6b; color: #2b0b0b; } .ar-box--image .ar-box-tag { background: #b48cff; color: #1f0f3a; }
.ar-box-grab { position: absolute; inset: 0; cursor: move; }
.ar-box-in { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; }
.ar-box--text .ar-box-in { top: 6px; justify-content: center; }
.ar-words, .ar-caption { overflow: hidden; scrollbar-width: none; }
.ar-words { box-sizing: border-box; width: 100%; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 700;
  font-size: clamp(14px, 4.5cqw, 34px); letter-spacing: 0.03em; color: #7a5a12; outline: none; resize: none; line-height: 1.15; }
.ar-caption { box-sizing: border-box; width: 100%; border: 0; border-radius: 6px; background: rgba(255,255,255,0.78); color: #3a2c1e;
  font: inherit; font-size: 12px; line-height: 1.35; padding: 5px 8px; resize: none; outline: none; }
.ar-caption::placeholder { color: #8a7a62; }
.ar-box--text .ar-caption { font-size: 11px; text-align: center; background: rgba(255,255,255,0.55); }
.ar-box-img { flex: 1 1 auto; min-height: 24px; border-radius: 4px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.45); color: #5b3fa0; font-size: 12px; font-weight: 600; cursor: pointer; }
.ar-box-photo { position: absolute; inset: 0; border-radius: 4px; background-size: cover; background-position: center; cursor: pointer; }
.ar-box--image .ar-box-in-top { top: 6px; bottom: 6px; }
.ar-box--image .ar-box-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 4px; }
.ar-describe { align-self: flex-end; min-height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: #8a5cf6; color: #fff;
  font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.ar-describe:disabled { opacity: 0.7; cursor: progress; }
.ar-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.55; }
.ar-canvas.has-photo { background-image: none; }
.ar-canvas.has-result .ar-photo { display: none; }
.ar-handle { position: absolute; right: -7px; bottom: -7px; width: 16px; height: 16px; border-radius: 50%; background: #8a5cf6; border: 2px solid #f6efe4; cursor: nwse-resize; }
.ar-canvas { container-type: inline-size; }

/* Panel */
.ar-scene { box-sizing: border-box; width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14));
  background: rgba(8,5,10,0.4); color: var(--im-text, #f4e9e4); font: inherit; font-size: 0.88rem; line-height: 1.4; resize: vertical; }
.ar-card { margin: 14px 0; padding: 12px; border-radius: 12px; background: rgba(8,5,10,0.4); border: 1px solid #8a5cf6; }
.ar-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 0.86rem; font-weight: 600; }
.ar-kinds { display: inline-flex; border: 1px solid var(--im-border, rgba(216,163,94,0.14)); border-radius: 999px; overflow: hidden; }
.ar-kinds button { min-height: 30px; padding: 0 9px; border: 0; background: transparent; color: rgba(244,233,228,0.65); font: inherit; font-size: 0.74rem; cursor: pointer; }
.ar-kinds button.is-on { font-weight: 600; }
.ar-kinds button.is-on[data-kind="text"] { background: #f2c14e; color: #2b2000; } .ar-kinds button.is-on[data-kind="thing"] { background: #4fd1c5; color: #062a27; }
.ar-kinds button.is-on[data-kind="person"] { background: #ff6b6b; color: #2b0b0b; } .ar-kinds button.is-on[data-kind="image"] { background: #b48cff; color: #1f0f3a; }
.ar-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ar-btn { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14)); background: transparent;
  color: var(--im-gold, #d8a35e); font: inherit; font-size: 0.8rem; cursor: pointer; }
.ar-btn--quiet { color: rgba(244,233,228,0.65); }
.ar-note-warn { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: rgba(216,163,94,0.08); border: 1px solid rgba(216,163,94,0.25);
  font-size: 0.78rem; line-height: 1.45; color: #d9c79a; }
.ar-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.ar-mode { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.14)); background: rgba(8,5,10,0.4);
  color: var(--im-text, #f4e9e4); font: inherit; cursor: pointer; }
.ar-mode b { display: block; font-size: 0.9rem; } .ar-mode span { font-size: 0.74rem; color: rgba(244,233,228,0.6); }
.ar-mode.is-on { border-color: var(--im-gold, #d8a35e); background: var(--im-gold-lo, rgba(216,163,94,0.12)); }
.ar-done-list { margin: 6px 0 12px; padding-left: 18px; font-size: 0.84rem; line-height: 1.5; color: rgba(244,233,228,0.8); }


/* The chosen box's tag: its number, the four kinds and delete. */
.ar-box-tag.is-edit { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 8px; top: -30px; cursor: move; }
.ar-box-tag.is-edit b { margin-right: 4px; }
.ar-tag-kind, .ar-tag-del { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: inherit; opacity: 0.55; cursor: pointer; font: inherit; font-size: 15px; line-height: 1; }
.ar-tag-kind svg { width: 14px; height: 14px; }
.ar-tag-kind:hover, .ar-tag-del:hover { opacity: 1; background: rgba(0,0,0,0.12); }
.ar-tag-kind.is-on { opacity: 1; background: rgba(0,0,0,0.18); }
.ar-tag-del { margin-left: 2px; }
.ar-box.tag-in .ar-box-tag { top: 0; left: 0; border-radius: 4px 0 6px 0; }
.ar-box.tag-in .ar-box-in { top: 34px; }
.ar-box.tag-in:not(.ar-box--text) .ar-box-in { top: auto; }

/* Right-click menu. */
.ar-menu { position: fixed; z-index: 1000; min-width: 220px; padding: 6px; border-radius: 12px; background: #1a1216; border: 1px solid rgba(216,163,94,0.2);
  box-shadow: 0 18px 50px rgba(0,0,0,0.55); display: flex; flex-direction: column; }
.ar-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--im-text, #f4e9e4); font: inherit; font-size: 0.84rem; text-align: left; cursor: pointer; }
.ar-menu button:hover:not(:disabled), .ar-menu button:focus-visible { background: rgba(216,163,94,0.12); outline: none; }
.ar-menu button:disabled { opacity: 0.4; cursor: default; }
.ar-menu button.is-on { color: var(--im-gold-hi, #e9c08a); font-weight: 600; }
.ar-menu button.is-danger { color: #ff8a8a; }
.ar-menu i { display: inline-flex; width: 16px; height: 16px; flex: none; }
.ar-menu i svg { width: 16px; height: 16px; }
.ar-menu hr { width: 100%; height: 1px; margin: 4px 0; border: 0; background: rgba(255,255,255,0.08); }

.ar-hint { margin: 10px 0 0; font-size: 0.76rem; text-align: center; color: rgba(244,233,228,0.5); }

/* Four boxes or more: only the chosen box shows its line (text boxes keep their words). */
.ar-canvas.has-many .ar-box:not(.is-on):not(.ar-box--text) .ar-box-in, .ar-canvas.has-many .ar-box:not(.is-on):not(.ar-box--text) .ar-box-foot { display: none; }
.ar-canvas.has-many .ar-box--text:not(.is-on) .ar-caption { display: none; }
.ar-photo { opacity: var(--ar-photo-opacity, 0.55); }

/* Phone: the board is the column's width, the kinds strip floats over the canvas's left edge,
   the actions scroll sideways, panel under the canvas, the go button pinned. */
@media (max-width: 900px) {
  .ar-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ar-main { padding-top: calc(var(--kz-nav-h, 72px) + 8px); }
  .ar-page .nk-head.ar-head { margin: 8px 0 10px; }
  .ar-page .ar-head .nk-sub { font-size: 1.25rem; line-height: 1.2; }
  .ar-lead { display: none; }
  .ar-board { padding-left: 0; }
  .ar-tools { right: auto; left: 8px; top: 8px; z-index: 5; background: rgba(14,10,12,0.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
  .ar-act--gold small { display: none; }
  /* The box toolbar floats over the canvas's left edge here: centre the empty-canvas hint in the space beside it. */
  .ar-empty { left: calc(50% + 42px); width: calc(100% - 112px); }
  .ar-menu { min-width: 200px; }
  .ar-panel { padding-bottom: 84px; }
  .ar-panel .nk-go { position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 30; width: auto; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
}

/* ── Review 10 Nov: one headline, the strips' corner button, mode as coins in the strip, a slim panel ── */
.ar-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ar-lead { display: none; }
.ar-head { justify-content: flex-start; }
.ar-page .ar-head .nk-sub i { font-family: 'Playfair Display', serif; font-style: italic; }

/* The toggle sits where the two strips meet, so it stays put when they shut. */
.ar-actions-row { position: relative; margin-bottom: 10px; }
.ar-actions-row .ar-actions { margin-bottom: 0; }
.ar-actions-row .ar-strips-btn { position: absolute; top: 50%; right: calc(100% + 10px); transform: translateY(-50%); width: 48px; height: 48px; border-radius: 12px; }
.ar-board.strips-off .ar-actions-row { min-height: 48px; }

/* Mode: two gold coins. */
.ar-coins { display: inline-flex; gap: 4px; margin-left: auto; padding: 2px; border-radius: 10px; background: rgba(255,255,255,0.04); flex: none; }
.ar-coin { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; color: rgba(244,233,228,0.7); font: inherit; font-size: 0.9rem; cursor: pointer; }
.ar-coin b { font-weight: 700; }
.ar-coin i, .ar-go-coin i { display: inline-block; width: 15px; height: 15px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, #fff1c4 0 18%, #f2c14e 40%, #b9821f 100%); box-shadow: inset 0 0 0 1.5px rgba(120,80,10,0.55); }
.ar-coin:hover { color: #fff; }
.ar-coin.is-on { border-color: var(--im-gold, #d8a35e); background: rgba(216,163,94,0.14); color: var(--im-gold-hi, #e9c08a); }
.ar-coin::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px;
  background: #1a1216; border: 1px solid rgba(216,163,94,0.25); color: var(--im-text, #f4e9e4); font-size: 0.76rem; font-weight: 500; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.12s; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.ar-coin:hover::after, .ar-coin:focus-visible::after { opacity: 1; }
.ar-act--gold { margin-left: 4px; }
.ar-go-coin { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.ar-actions { overflow: visible; }

/* Slim panel, level with the canvas's top, staying in view. */
.ar-layout { align-items: start; }
@media (min-width: 901px) { .ar-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (min-width: 901px) { .ar-panel { position: sticky; top: 20px; } }
.ar-card-head .ar-btn { min-height: 30px; }
.ar-card { margin: 12px 0; }
.ar-panel .nk-go { margin-top: 14px; }

@media (max-width: 900px) {
  .ar-actions-row { display: flex; gap: 8px; align-items: center; }
  .ar-actions-row .ar-strips-btn { position: static; transform: none; width: 46px; height: 46px; }
  .ar-actions-row .ar-actions { flex: 1 1 auto; min-width: 0; overflow-x: auto; }
  .ar-coin::after { display: none; }
  .ar-coin { padding: 0 8px; }
  .ar-act-label { display: none; }
}

/* The headline sits centred over the canvas column (the board is centred there too). */
@media (min-width: 901px) {
  .ar-page .nk-head.ar-head { justify-content: center; text-align: center; padding-right: calc(320px + 18px); padding-left: 58px; box-sizing: border-box; }
}
@media (max-width: 900px) { .ar-page .nk-head.ar-head { justify-content: center; text-align: center; } }
/* Phone: the toggle moves up to the canvas-size line, so the actions strip has the full width. */
@media (max-width: 900px) {
  .ar-actions-row { display: block; }
  .ar-actions-row .ar-strips-btn { position: absolute; top: -54px; right: 0; width: 44px; height: 44px; }
  .ar-topline { padding-right: 52px; min-height: 44px; }
  .ar-act { min-width: 34px; padding: 0 6px; }
  .ar-act--gold { padding: 0 10px; }
}

/* One top line: the strip (with the canvas size in it) and the panel start level; the canvas sits right under the strip. */
.ar-actions .ar-size { flex: none; }
.ar-actions .ar-size select { min-height: 36px; border-color: transparent; background: rgba(255,255,255,0.05); }
.ar-head { margin-bottom: 18px; }
@media (max-width: 900px) {
  .ar-topline { display: none; }
  /* The toggle sits on the canvas's top-left corner; the kinds strip hangs under it. */
  .ar-actions-row .ar-strips-btn { top: calc(100% + 18px); left: 8px; right: auto; width: 46px; height: 46px; z-index: 6;
    background: rgba(14,10,12,0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .ar-tools { top: 62px; }
  .ar-actions .ar-size select { width: auto; padding: 0 6px; }
  .ar-act { min-width: 32px; padding: 0 4px; }
  .ar-coin { padding: 0 6px; gap: 4px; }
  .ar-act-sep { margin: 0 2px; }
}
@media (max-width: 900px) {
  .ar-act-sep { display: none; }
  .ar-actions { gap: 2px; padding: 4px; }
  .ar-actions .ar-size select { padding: 0 2px 0 6px; font-size: 0.82rem; }
  .ar-coins { padding: 1px; gap: 2px; }
  .ar-act--gold { padding: 0 9px; margin-left: 2px; }
}

/* ── No side panel: one centred column. Under the canvas, a dock the canvas's width:
   ✎ Scene (opens a box the same width), a status line, Paint at the corner. ── */
.ar-layout { display: block; }
@media (min-width: 901px) {
  .ar-layout { grid-template-columns: none; }
  .ar-page .nk-head.ar-head { padding-right: 0; }
}
.ar-dock { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.ar-dock-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.ar-dock-note { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 0.8rem; color: rgba(244,233,228,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-go.nk-go { width: auto; margin: 0 0 0 auto; padding: 0 22px; min-height: 48px; flex: none; }
.ar-scene-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px; flex: none;
  border: 1px solid var(--im-border, rgba(216,163,94,0.18)); background: rgba(42,18,28,0.55); color: var(--im-text, #f4e9e4); font: inherit; font-size: 0.88rem; cursor: pointer; }
.ar-scene-btn svg { width: 17px; height: 17px; color: var(--im-gold, #d8a35e); }
.ar-scene-btn:hover, .ar-scene-btn[aria-expanded="true"] { border-color: var(--im-gold, #d8a35e); }
.ar-dot-glow { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: #f2c14e;
  box-shadow: 0 0 0 0 rgba(242,193,78,0.7); animation: ar-glow 1.8s ease-out infinite; }
@keyframes ar-glow { 0% { box-shadow: 0 0 0 0 rgba(242,193,78,0.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(242,193,78,0); } }
@media (prefers-reduced-motion: reduce) { .ar-dot-glow { animation: none; } }
.ar-scene-wrap[hidden] { display: none; }
.ar-dock .ar-scene { min-height: 64px; font-size: 0.92rem; }
.ar-dock-actions { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.ar-dock-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--im-border, rgba(216,163,94,0.18));
  background: transparent; color: rgba(244,233,228,0.85); font: inherit; font-size: 0.84rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.ar-dock-btn:hover { border-color: var(--im-gold, #d8a35e); color: #fff; }
.ar-dock-busy, .ar-dock-err { padding: 8px 12px; border-radius: 12px; background: rgba(42,18,28,0.55); border: 1px solid var(--im-border, rgba(216,163,94,0.18)); }
.ar-dock-err { border-color: rgba(255,120,120,0.35); }
.ar-dock-mithu { width: 32px; height: auto; flex: none; }
.ar-dock-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 0.84rem; color: rgba(244,233,228,0.7); }
.ar-dock-text b { color: var(--im-text, #f4e9e4); font-size: 0.9rem; }
.ar-dock-text .nk-progress { margin-top: 4px; }

/* ⓘ after the headline. */
.ar-info { position: relative; display: inline-block; vertical-align: super; margin-left: 10px; }
.ar-info-btn { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(216,163,94,0.7); background: transparent;
  color: var(--im-gold-hi, #e9c08a); font: 600 13px/1 Georgia, 'Times New Roman', serif; font-style: italic; cursor: pointer; }
.ar-info-btn:hover, .ar-info.is-open .ar-info-btn { background: rgba(216,163,94,0.15); }
.ar-info-tip { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); width: 300px; max-width: 80vw; padding: 12px 14px; border-radius: 12px;
  background: #1a1216; border: 1px solid rgba(216,163,94,0.25); box-shadow: 0 18px 40px rgba(0,0,0,0.55); z-index: 50;
  font-family: inherit; font-size: 0.8rem; font-weight: 400; line-height: 1.5; letter-spacing: 0; text-align: left; color: rgba(244,233,228,0.85);
  opacity: 0; visibility: hidden; transition: opacity 0.12s; }
.ar-info-tip b { color: var(--im-gold-hi, #e9c08a); }
.ar-info:hover .ar-info-tip, .ar-info.is-open .ar-info-tip { opacity: 1; visibility: visible; }

@media (max-width: 900px) {
  .ar-info-tip { left: auto; right: -40px; transform: none; }
  .ar-panel .nk-go, .ar-dock .nk-go { position: static; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
  /* The dock stays reachable on a phone: it rides the bottom of the screen while the canvas scrolls. */
  .ar-dock { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 20; padding: 8px; margin-top: 10px; border-radius: 16px;
    background: rgba(14,10,12,0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.07); }
  .ar-dock-row { gap: 8px; min-height: 46px; }
  .ar-dock-note { display: none; }
  .ar-go.nk-go { padding: 0 16px; min-height: 46px; font-size: 0.95rem; }
  .ar-dock-actions .ar-dock-btn { padding: 0 9px; font-size: 0.8rem; }
}
.ar-headline { display: flex; align-items: flex-start; justify-content: center; gap: 4px; }
.ar-headline .nk-sub em { font-style: italic; color: var(--im-gold-hi, #e9c08a); }
.ar-headline .ar-info { vertical-align: baseline; margin: 6px 0 0 8px; }
@media (max-width: 900px) { .ar-headline .ar-info { margin-top: 2px; } }
.ar-page .nk-head.ar-head { position: relative; z-index: 40; }

/* ✎ Scene asks for attention the Studio's way: the composer's slowly turning gold-and-violet
   streak (imagine.css .im-comp-ring) runs round it until a scene is written. */
@property --ar-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ar-scene-btn { isolation: isolate; }
.ar-scene-btn.is-empty::before, .ar-scene-btn.is-empty::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--ar-a), transparent 0 58%, rgba(216, 163, 94, 0.95) 70%, rgba(150, 120, 255, 0.95) 80%, transparent 92%);
  animation: arSpin 4.5s linear infinite; }
.ar-scene-btn.is-empty::before { z-index: 2; padding: 1.5px; -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.ar-scene-btn.is-empty::after { z-index: -1; inset: -5px; filter: blur(12px); opacity: 0.5; }
.ar-scene-btn.is-empty { border-color: rgba(255,255,255,0.08); }
@keyframes arSpin { to { --ar-a: 360deg; } }
@media (prefers-reduced-motion: reduce) { .ar-scene-btn.is-empty::before, .ar-scene-btn.is-empty::after { animation: none; } }

/* Coins: the Studio's gold diamond (imagine.js _COIN_SVG), not a round coin. */
.ar-coin i, .ar-go-coin i { width: 12px; height: 12px; border-radius: 0; box-shadow: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 9-7 9-7-9 7-9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 9-7 9-7-9 7-9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ar-coin i { color: var(--im-gold, #d8a35e); }
.ar-coin.is-on i { color: var(--im-gold-hi, #e9c08a); }
.ar-go-coin i { color: #ffe2a8; }

/* The scene box opens upward, floating over the canvas's lower edge: nothing under it moves. */
.ar-dock { position: relative; }
.ar-scene-wrap { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 25; padding: 12px; border-radius: 14px;
  background: rgba(20,13,17,0.94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(216,163,94,0.35); box-shadow: 0 -12px 40px rgba(0,0,0,0.45);
  animation: arRise 0.16s ease-out; }
@keyframes arRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ar-scene-wrap { animation: none; } }
.ar-scene-k { margin: 0 0 8px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--im-gold, #d8a35e); }
.ar-dock .ar-scene { min-height: 72px; resize: none; }
.ar-scene-done { display: block; margin: 8px 0 0 auto; min-height: 34px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--im-gold, #d8a35e);
  background: rgba(216,163,94,0.14); color: var(--im-gold-hi, #e9c08a); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
@media (max-width: 900px) {
  .ar-scene-wrap { left: -8px; right: -8px; bottom: calc(100% + 8px); }
  .ar-dock .ar-scene { font-size: 16px; }   /* 16px keeps iOS from zooming the page on focus */
}

/* ✦ Draft in the scene box: an idea written into a whole layout. */
.ar-scene-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ar-scene-foot .ar-scene-done { margin: 0 0 0 auto; }
.ar-draft { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--im-gold, #d8a35e);
  background: linear-gradient(135deg, rgba(216,163,94,0.22), rgba(150,120,255,0.16)); color: var(--im-gold-hi, #e9c08a); font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.ar-draft small { font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.ar-draft:hover { border-color: #f2c14e; color: #fff; }
.ar-draft.is-busy { opacity: 0.75; cursor: progress; }
.ar-empty b { font-weight: 600; color: #7a5a12; }
.ar-box--text.is-thin:not(.is-on) .ar-caption { display: none; }

/* ── History: the session as a vertical graph (VS Code style), opened from ⟲ in the strip.
   Rows are one line; everything secondary is on the hover card (desktop) or under the
   tapped row (phone). Beside the canvas when there is room, else over its right edge;
   a bottom sheet on phones. ── */
.ar-hist-btn { gap: 5px; border: 1px solid transparent; }
.ar-hist-btn[aria-expanded="true"] { border-color: var(--im-gold, #d8a35e); color: var(--im-gold-hi, #e9c08a); background: rgba(216,163,94,0.12); }
.ar-hist-badge { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--im-gold, #d8a35e); color: #2b1a05;
  font-size: 10.5px; font-weight: 700; display: inline-grid; place-items: center; }
.ar-hist { position: absolute; top: 0; left: calc(100% + 16px); width: 252px; max-height: calc(100% + 64px); z-index: 30; display: flex; flex-direction: column;
  background: rgba(22,15,19,0.97); border: 1px solid rgba(216,163,94,0.22); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  animation: arHistIn 0.16s ease-out; }
.ar-hist.is-inside { left: auto; right: 8px; top: 8px; max-height: calc(100% - 16px); }
@keyframes arHistIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.ar-hist-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 9px 14px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ar-hist-head b { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--im-gold, #d8a35e); }
.ar-hist-head span { font-size: 0.74rem; color: rgba(244,233,228,0.4); }
.ar-hist-x { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: rgba(244,233,228,0.6); font-size: 18px; cursor: pointer; }
.ar-hist-x:hover { background: rgba(255,255,255,0.07); }
.ar-hist-list { position: relative; overflow-y: auto; padding: 6px 0; scrollbar-width: thin; min-height: 0; }
.ar-graph { position: absolute; left: 0; top: 6px; pointer-events: none; }
.ar-m { position: relative; display: grid; grid-template-columns: var(--gw) minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%; height: 38px;
  padding: 0 12px 0 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ar-m:hover, .ar-m:focus-visible { background: rgba(255,255,255,0.045); outline: none; }
.ar-m-l { min-width: 0; font-size: 0.84rem; color: rgba(244,233,228,0.82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-m--paint .ar-m-l { color: var(--im-text, #f4e9e4); font-weight: 600; }
.ar-m.is-cur .ar-m-l { color: var(--im-gold-hi, #e9c08a); }
.ar-chip { height: 19px; padding: 0 7px; border-radius: 10px; font-size: 0.68rem; font-weight: 600; display: inline-flex; align-items: center; }
.ar-chip--now { background: rgba(216,163,94,0.16); color: var(--im-gold-hi, #e9c08a); border: 1px solid rgba(216,163,94,0.5); }
.ar-chip--br { background: rgba(154,124,255,0.14); color: #c6b6ff; border: 1px solid rgba(154,124,255,0.45); }
.ar-hist-empty { margin: 0; padding: 16px 14px; font-size: 0.8rem; color: rgba(244,233,228,0.55); line-height: 1.5; }
.ar-hist-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.ar-hist-foot button, .ar-hist-confirm button { flex: 1; min-height: 32px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.1); background: transparent;
  color: rgba(244,233,228,0.7); font: inherit; font-size: 0.78rem; cursor: pointer; }
.ar-hist-foot button:hover:not(:disabled) { color: #fff; border-color: rgba(216,163,94,0.45); }
.ar-hist-foot button:disabled { opacity: 0.4; cursor: default; }
.ar-hist-foot .del, .ar-hist-confirm .yes { color: #ff9a9a; }
.ar-hist-confirm { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.78rem; color: rgba(244,233,228,0.7); }
.ar-hist-confirm[hidden] { display: none; }
.ar-hist-confirm div { display: flex; gap: 8px; margin-top: 8px; }
.ar-hist-confirm .yes { border-color: rgba(255,120,120,0.5); }

/* The detail card (hover on desktop). */
.ar-peek { position: absolute; right: calc(100% + 10px); width: 260px; border-radius: 14px; overflow: hidden; z-index: 31;
  background: #1a1216; border: 1px solid rgba(216,163,94,0.25); box-shadow: 0 22px 50px rgba(0,0,0,0.6);
  opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.ar-peek.is-on { opacity: 1; pointer-events: auto; }
.ar-card-art { height: 150px; display: grid; place-items: center; padding: 10px; background: radial-gradient(circle at 50% 40%, rgba(216,163,94,0.12), transparent 70%), #140d11;
  border-bottom: 1px solid rgba(255,255,255,0.08); }
.ar-card-art img { max-height: 130px; max-width: 100%; border-radius: 6px; box-shadow: 0 10px 26px rgba(0,0,0,0.5); }
.ar-mini { position: relative; height: 130px; max-width: 100%; border-radius: 6px; background: #f6efe4; box-shadow: 0 10px 26px rgba(0,0,0,0.5); }
.ar-mini span { position: absolute; border: 1.5px dashed; border-radius: 3px; overflow: hidden; display: grid; place-items: center; }
.ar-mini i { font: 700 9px/1.1 Inter, system-ui, sans-serif; font-style: normal; color: #7a5a12; text-align: center; padding: 1px; }
.ar-card-b { padding: 11px 13px 12px; display: grid; gap: 7px; }
.ar-card-t { font-size: 0.86rem; font-weight: 600; color: var(--im-text, #f4e9e4); }
.ar-card-l { display: flex; align-items: flex-start; gap: 7px; font-size: 0.76rem; line-height: 1.4; color: rgba(244,233,228,0.6); }
.ar-card-l svg { width: 13px; height: 13px; flex: none; margin-top: 2px; opacity: 0.75; }
.ar-card-l q { quotes: '“' '”'; color: var(--im-text, #f4e9e4); }
.ar-card-l b { color: var(--im-gold-hi, #e9c08a); font-weight: 600; }
.ar-card-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 9px; margin-top: 2px; border-top: 1px solid rgba(255,255,255,0.08); }
.ar-card-acts button, .ar-card-acts a { min-height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: transparent;
  color: rgba(244,233,228,0.7); font: inherit; font-size: 0.74rem; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.ar-card-acts button:hover, .ar-card-acts a:hover { color: #fff; border-color: rgba(216,163,94,0.45); }
.ar-card-acts .go { margin-left: auto; color: var(--im-gold-hi, #e9c08a); border-color: rgba(216,163,94,0.5); }
.ar-m-detail { padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.02); }
.ar-m-detail .ar-card-b { padding: 0; }

.ar-hist-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.45); }
.ar-hist-scrim[hidden] { display: none; }
@media (max-width: 900px) {
  /* A bottom sheet. */
  .ar-hist { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 72vh; max-height: 72vh; z-index: 61; border-radius: 22px 22px 0 0;
    border-width: 1px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); animation: arSheetIn 0.2s ease-out; }
  .ar-hist::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.22); margin: 8px auto 0; }
  @keyframes arSheetIn { from { transform: translateY(40%); opacity: 0.4; } to { transform: none; opacity: 1; } }
  .ar-hist-list { flex: 1 1 auto; }
  .ar-m { height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ar-hist { animation: none; } .ar-peek { transition: none; } }
/* After a painting the dock keeps one row: Scene, then compact actions, then Paint again. */
.ar-dock-actions { flex-wrap: nowrap; gap: 6px; }
.ar-dock-btn { padding: 0 10px; }
.ar-dock-ico { width: 40px; padding: 0; justify-content: center; }
.ar-dock-ico svg { width: 17px; height: 17px; }
@media (max-width: 900px) { .ar-dock-row:has(.ar-dock-actions) .ar-scene-btn span { display: none; } .ar-dock-row:has(.ar-dock-actions) .ar-scene-btn { padding: 0 12px; } }
.ar-actions.is-tight .ar-act-label { display: none; } .ar-actions.is-tight .ar-act--gold { padding: 0 10px; }
/* Phone: ⟲ sits on the canvas's top-right corner (the tools toggle is on the top-left), so the strip still fits. */
@media (max-width: 900px) {
  .ar-actions .ar-hist-btn { position: absolute; top: calc(100% + 18px); right: 8px; z-index: 6; width: auto; height: 42px; padding: 0 10px; border-radius: 12px;
    background: rgba(14,10,12,0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(216,163,94,0.45); color: var(--im-gold-hi, #e9c08a); }
}
/* The sheet and scrim when moved to <body> on a phone. */
body > .ar-hist { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1001; background: #160f13; }
body > .ar-hist-scrim { z-index: 1000; }

/* ── ✦ Expert in the dock, its settings opening upward like the scene box ── */
.ar-expert-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 12px; flex: none; cursor: pointer;
  border: 1px solid var(--im-border, rgba(216,163,94,0.18)); background: rgba(42,18,28,0.55); color: rgba(244,233,228,0.75); font: inherit; font-size: 0.86rem; }
.ar-expert-btn.is-on { border-color: var(--im-gold, #d8a35e); color: var(--im-gold-hi, #e9c08a); background: rgba(216,163,94,0.12); }
.ar-expert-wrap { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 25; padding: 12px; border-radius: 14px;
  background: rgba(20,13,17,0.95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid rgba(216,163,94,0.35);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.45); animation: arRise 0.16s ease-out; }
.ar-expert-wrap[hidden] { display: none; }
.ar-segs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 11px; background: rgba(255,255,255,0.05); }
.ar-seg { min-height: 36px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: rgba(244,233,228,0.7); font: inherit; font-size: 0.84rem; cursor: pointer; }
.ar-seg.is-on { border-color: var(--im-gold, #d8a35e); background: rgba(216,163,94,0.14); color: var(--im-gold-hi, #e9c08a); font-weight: 600; }
.ar-ex-note { margin: 8px 2px 10px; font-size: 0.76rem; color: rgba(244,233,228,0.55); }
.ar-ex-row { display: flex; align-items: flex-start; gap: 8px; font-size: 0.8rem; color: rgba(244,233,228,0.8); line-height: 1.4; cursor: pointer; }
.ar-ex-row input { margin-top: 3px; accent-color: #d8a35e; }
.ar-ex-row b { color: var(--im-text, #f4e9e4); }
.ar-ex-row i { color: rgba(244,233,228,0.55); }
.ar-expert-wrap .ar-scene-done { margin-top: 10px; }
@media (max-width: 900px) {
  .ar-expert-wrap { left: -8px; right: -8px; }
  .ar-expert-btn { padding: 0 10px; font-size: 0.8rem; }
}

/* ── Turning a box ── */
.ar-box { transform-origin: 50% 50%; }
.ar-rot { position: absolute; left: 50%; top: -34px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; display: grid; place-items: center;
  background: #8a5cf6; color: #fff; font-size: 13px; line-height: 1; cursor: grab; box-shadow: 0 2px 8px rgba(0,0,0,0.35); z-index: 3; touch-action: none; }
.ar-rot::after { content: ''; position: absolute; left: 50%; top: 22px; width: 1.5px; height: 12px; background: #8a5cf6; }
.ar-box.tag-in .ar-rot { top: 30px; }
.ar-rot-deg { position: absolute; right: 2px; top: 2px; padding: 1px 5px; border-radius: 5px; background: rgba(138,92,246,0.9); color: #fff; font-size: 10px; font-weight: 600; z-index: 3; }

/* ── Changing the words on a painting ── */
.ar-canvas.is-text-edit .ar-box { display: none; }
.ar-te { position: absolute; box-sizing: border-box; border: 2px dashed #f2c14e; border-radius: 6px; background: rgba(20,13,17,0.85); transform-origin: 50% 50%; display: flex; }
.ar-te textarea { width: 100%; height: 100%; box-sizing: border-box; border: 0; align-self: center; background: transparent; resize: none; outline: none; padding: 6px;
  color: #fff; font: 700 clamp(12px, 3.6cqw, 26px)/1.2 Inter, system-ui, sans-serif; text-align: center; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.ar-card-acts .rm { color: #ff9a9a; }
.ar-dock-gap { flex: 1 1 auto; }
.ar-hist[hidden], body > .ar-hist[hidden] { display: none !important; }
@media (max-width: 900px) { .ar-ex-word, .ar-go-mode { display: none; } }

/* A turned box: its name tag (and the tools in it while editing) stays level and readable, pivoting on
   the corner it hangs from, instead of tilting with the box (10 Nov 2026). */
.ar-box-tag { transform: rotate(calc(var(--rot, 0deg) * -1)); transform-origin: left bottom; }
.ar-box.tag-in .ar-box-tag { transform-origin: left top; }

/* While a painting is made: our K forming in a field of dots, and how far along (kz-forming.js) */
.kz-forming { position: absolute; inset: 0; z-index: 40; border-radius: inherit; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, rgba(30,18,24,0.94), rgba(12,9,11,0.97)); transition: opacity .35s ease; }
.kz-forming canvas { position: absolute; inset: 0; }
.kz-forming-label { position: absolute; left: 16px; top: 14px; font: 500 13px/1 Inter, system-ui, sans-serif; color: rgba(244,233,228,0.72); }
.kz-forming-pct { position: absolute; right: 14px; bottom: 14px; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,0.92);
  color: #1d1420; font: 600 12px/1 Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.kz-forming.is-out { opacity: 0; }
/* Music while you wait (kz-forming.js): off until asked for, remembered */
.kz-forming-sound { position: absolute; right: 12px; top: 10px; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.14); background: rgba(20,14,18,0.6); color: rgba(244,233,228,0.8);
  font: 500 12px/1 Inter, system-ui, sans-serif; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.kz-forming-sound:hover { color: #f4e9e4; border-color: rgba(216,163,94,0.55); }
.kz-forming-sound.is-on { color: #1d1420; background: linear-gradient(135deg, #e3b877, #c9935a); border-color: transparent; }
.kz-forming-sound:focus-visible { outline: 2px solid #d8a35e; outline-offset: 2px; }

/* The size chip beside the mode coins: 1K by default, flips to 2K (10 Nov 2026) */
.ar-size { position: relative; margin-left: auto; height: 32px; padding: 0 10px; border-radius: 8px; flex: none; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: rgba(244,233,228,0.8);
  font: 700 12px/1 Inter, system-ui, sans-serif; letter-spacing: 0.04em; }
.ar-size:hover { color: #fff; border-color: rgba(216,163,94,0.5); }
.ar-size.is-2k { border-color: var(--im-gold, #d8a35e); color: var(--im-gold-hi, #e9c08a); background: rgba(216,163,94,0.14); }
.ar-size::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px;
  background: #1c1418; border: 1px solid rgba(255,255,255,0.1); color: #f4e9e4; font: 500 11.5px/1.3 Inter, system-ui, sans-serif; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 30; }
.ar-size:hover::after, .ar-size:focus-visible::after { opacity: 1; }
.ar-size + .ar-coins { margin-left: 6px; }
@media (hover: none) { .ar-size::after { display: none; } }

/* The members' price note under the title (kz-member-note, kz-standard.css). */
.ar-member-note { margin-top: 6px; }

/* Compact dock (11 Nov 2026): Scene and Expert are square icon buttons (names in tooltips and for screen readers);
   Expert's state is a dot (gold when on). Paint shows its word and price; the mode is in the strip above. */
.ar-icon-btn { width: 44px; min-width: 44px; padding: 0; justify-content: center; position: relative; }
.ar-expert-btn.ar-icon-btn { font-size: 1rem; }
.ar-ex-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: rgba(244,233,228,0.28); }
.ar-expert-btn.is-on .ar-ex-dot { background: var(--im-gold, #d8a35e); box-shadow: 0 0 6px rgba(216,163,94,0.7); }

/* Compact strip (11 Nov 2026): the tools fit the canvas width. Size shows just the ratio (names while the list is
   open), the history count sits on its icon, the mode coins are tighter. If a canvas is still narrower than the
   tools, the strip wraps inside its width instead of running past it. */
.ar-actions { flex-wrap: wrap; row-gap: 4px; }
.ar-actions .ar-size select { padding: 0 8px; font-size: 0.8rem; letter-spacing: 0; }
.ar-actions .ar-coin { padding: 0 7px; gap: 4px; }
@media (min-width: 901px) {
  .ar-actions .ar-hist-btn { position: relative; gap: 0; width: 36px; padding: 0; justify-content: center; }
  .ar-actions .ar-hist-btn .ar-hist-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
    font-size: 10px; line-height: 16px; }
}
/* .ar-size names both the canvas-size picker (a label) and the 1K button; the button's rules must not move the picker. */
.ar-actions label.ar-size { margin-left: 0; padding: 0; height: auto; cursor: default; }

/* Output: one button for size + mode ("1K · ◇3 ⌄"); its menu lists the four with their prices. */
.ar-out { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; height: 34px; padding: 0 8px 0 11px; border-radius: 9px; flex: none;
  border: 1px solid rgba(216,163,94,0.45); background: rgba(216,163,94,0.1); color: var(--im-gold-hi, #e9c08a);
  font: 700 12.5px/1 Inter, system-ui, sans-serif; letter-spacing: 0.02em; cursor: pointer; }
.ar-out:hover, .ar-out[aria-expanded="true"] { border-color: var(--im-gold, #d8a35e); background: rgba(216,163,94,0.18); }
.ar-out.is-master { box-shadow: inset 0 0 0 1px rgba(233,192,138,0.35); }
.ar-out-sep { opacity: 0.5; }
.ar-out svg { width: 13px; height: 13px; opacity: 0.8; }
.ar-out i, .ar-out-price i { display: inline-block; width: 11px; height: 11px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 9-7 9-7-9 7-9z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 9-7 9-7-9 7-9z'/%3E%3C/svg%3E") center / contain no-repeat; }
.ar-out-menu { min-width: 250px; }
.ar-out-menu button { justify-content: space-between; min-height: 44px; }
.ar-out-name { display: flex; flex-direction: column; gap: 2px; }
.ar-out-name small { font-size: 0.72rem; font-weight: 400; color: rgba(244,233,228,0.5); }
.ar-out-price { display: inline-flex; align-items: center; gap: 4px; color: var(--im-gold-hi, #e9c08a); font-weight: 700; }

/* One row, always (11 Nov 2026): Analyze is an icon like Scene and Expert (its name in the tooltip); background
   photo and show/hide boxes live in the vertical strip. No wrapping: the strip is designed to fit the narrowest canvas (~340px). */
.ar-actions { flex-wrap: nowrap; }
.ar-actions #arAnalyze { width: 36px; min-width: 36px; padding: 0; justify-content: center; }
.ar-actions #arAnalyze .ar-act-label, .ar-actions #arAnalyze small { display: none; }

/* Vertical strip: the box kinds, then the canvas tools used most (background photo, its strength while one is set,
   show/hide boxes). */
.ar-tools-sep { display: block; height: 1px; margin: 3px 6px; background: rgba(244,233,228,0.12); }
.ar-tools .ar-tool--act { color: rgba(244,233,228,0.72); }
.ar-tools .ar-tool--act:disabled { opacity: 0.35; cursor: default; }
.ar-tools #arBoxesBtn[aria-pressed="false"] { color: var(--im-gold-hi, #e9c08a); }
.ar-tools .ar-opacity--v { display: flex; justify-content: center; height: auto; padding: 4px 0; }
.ar-tools .ar-opacity--v[hidden] { display: none; }
.ar-tools .ar-opacity--v input { writing-mode: vertical-lr; direction: rtl; width: 18px; height: 84px; margin: 0; accent-color: var(--im-gold, #d8a35e); }
