/* The door, the editing forms and the company panel. Same table, same sheets as the board. */

body.booting #bar, body.booting #legend, body.booting #controls, body.booting #hint, body.at-door #bar, body.at-door #legend, body.at-door #controls, body.at-door #hint, body.at-door #stage { visibility: hidden; }

/* ---------- door ---------- */
#door { position: fixed; inset: 0; z-index: 60; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 1fr); background: var(--table); }
#door[hidden] { display: none; }
.door-scene { overflow: hidden; }
.door-scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
.door-sheet { align-self: center; justify-self: center; width: min(430px, calc(100vw - 40px)); margin: 24px; padding: 36px 34px 30px; background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow-float); display: flex; flex-direction: column; gap: 14px; }
.door-sheet.solo { grid-column: 1 / -1; }
.door-mark { border-radius: 12px; }
.door-sheet h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; margin: 6px 0 0; }
.door-sheet p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--ink-70); }
.door-sheet small { color: var(--ink-55); font-size: 13px; }
.door-msg { padding: 10px 14px; border-radius: 12px; background: color-mix(in oklab, var(--defect) 14%, var(--sheet)); color: var(--ink) !important; font-size: 14.5px !important; }
.door-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 14px; background: var(--ink); color: var(--table); font-size: 16px; font-weight: 700; text-decoration: none; margin-top: 8px; transition: transform .1s; }
.door-btn:active { transform: scale(.98); }
.door-btn.alt { background: var(--btn); color: #fff; width: 100%; }
.door-dev { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--ink-12); }
.door-dev label { display: flex; flex-direction: column; gap: 6px; font: 600 11.5px var(--font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-40); }
.door-dev input { height: 46px; }
@media (max-width: 820px) { #door { grid-template-columns: 1fr; grid-template-rows: 34vh 1fr; } .door-sheet { align-self: start; margin-top: -40px; } }

/* ---------- inputs ---------- */
input, select, textarea { font: 500 15px var(--font-ui); color: var(--ink); background: var(--sheet-2); border: 1.5px solid var(--ink-12); border-radius: 10px; padding: 9px 11px; outline: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
#q { border: 0; background: none; border-radius: 0; }
textarea { resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--btn); box-shadow: 0 0 0 3px var(--purple-tint); }
input:disabled, select:disabled { opacity: .55; }
.f { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.f > span { font: 600 11.5px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-40); }
.f2 { display: flex; gap: 10px; align-items: flex-end; }
.check { flex-direction: row !important; align-items: center; gap: 8px; flex: none; white-space: nowrap; display: flex; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--btn); }
.check > span { font: 600 14px var(--font-ui) !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--ink) !important; }
.edit { display: flex; flex-direction: column; gap: 12px; }
.edit.wide { max-width: 720px; }
.edit.inline { flex-direction: row; flex-wrap: wrap; align-items: center; }
.edit.inline input, .edit.inline select { width: auto; flex: 1 1 180px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn { height: 40px; padding: 0 16px; border-radius: 12px; background: var(--btn); color: #fff; font-size: 14.5px; font-weight: 700; transition: transform .1s, opacity .15s; flex: none; }
.btn:active { transform: scale(.97); }
.btn.quiet { background: var(--ink-07); color: var(--ink); }
.btn:disabled { opacity: .6; }
.btn.busy { background-image: linear-gradient(90deg, transparent 25%, rgba(255,255,255,.35) 50%, transparent 75%); background-size: 200% 100%; animation: shim 1s linear infinite; }
.mini { font: 600 12.5px var(--font-ui); padding: 5px 10px 6px; border-radius: 9px; background: var(--ink-07); color: var(--ink-70); text-decoration: none; flex: none; }
.mini:hover, .mini.on { background: var(--ink); color: var(--table); }
.piece-actions { padding-top: 6px; border-top: 1px solid var(--ink-12); }
.by { color: var(--ink-40) !important; }

.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--btn); color: #fff; font-weight: 800; font-size: 15px; overflow: hidden; display: grid; place-items: center; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
#company-btn b { font: 700 11px var(--font-mono); background: var(--btn); color: #fff; padding: 2px 7px; border-radius: 999px; }

/* ---------- history and changes ---------- */
.hist { padding: 10px 0; border-top: 1px solid var(--ink-07); display: flex; flex-direction: column; gap: 6px; }
.hist-h { font-size: 14.5px; line-height: 1.4; }
.hist-h time { display: block; font: 500 12px var(--font-mono); color: var(--ink-40); }
.chg { display: grid; grid-template-columns: 96px 1fr; gap: 2px 10px; font-size: 13.5px; line-height: 1.4; padding: 6px 10px; border-radius: 10px; background: var(--ink-07); }
.chg b { grid-row: span 2; font: 600 12px var(--font-mono); color: var(--ink-55); padding-top: 2px; word-break: break-word; }
.chg .was { color: var(--ink-55); text-decoration: line-through; word-break: break-word; }
.chg .now { color: var(--ink); word-break: break-word; }
.tag { font: 600 11.5px var(--font-ui); padding: 2px 8px 3px; border-radius: 999px; background: var(--purple-tint); color: var(--btn); white-space: nowrap; }

/* ---------- company panel ---------- */
#panel { position: fixed; inset: 0; z-index: 45; background: rgba(23, 21, 31, .32); display: grid; place-items: center; padding: 20px; }
#panel[hidden] { display: none; }
.p-sheet { width: min(1120px, 100%); height: min(860px, 100%); background: var(--table); border-radius: 24px; box-shadow: var(--shadow-float); display: grid; grid-template-rows: auto auto 1fr; overflow: hidden; animation: rise .2s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.p-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 26px 6px; position: relative; }
.p-head h2 { margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -.025em; }
.p-head .drawer-close { position: static; }
.p-tabs { display: flex; gap: 4px; padding: 10px 22px 12px; overflow-x: auto; scrollbar-width: none; }
.p-tabs button { white-space: nowrap; padding: 8px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 650; color: var(--ink-70); }
.p-tabs button:hover { background: var(--ink-07); }
.p-tabs button.on { background: var(--ink); color: var(--table); }
.p-body { overflow-y: auto; padding: 8px 26px 30px; display: flex; flex-direction: column; gap: 14px; }
.p-body h3 { margin: 14px 0 0; font-size: 18px; font-weight: 750; }
.p-lead { margin: 0; font-size: 15.5px; line-height: 1.45; color: var(--ink-70); max-width: 78ch; }
.note { margin: 0; font-size: 13.5px; color: var(--ink-55); line-height: 1.45; }
.note code, .p-line code { font: 500 12.5px var(--font-mono); background: var(--ink-07); padding: 2px 6px; border-radius: 6px; }
.p-card { background: var(--sheet); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sheet); display: flex; flex-direction: column; gap: 10px; }
.p-card-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 16px; }
.p-card-h time, .p-line time { margin-left: auto; font: 500 12px var(--font-mono); color: var(--ink-40); }
.p-card.key { border: 2px solid var(--btn); }
.secret { font: 600 14px var(--font-mono); padding: 12px 14px; border-radius: 10px; background: var(--ink-07); word-break: break-all; user-select: all; }
.p-empty { padding: 34px; text-align: center; color: var(--ink-55); background: var(--band); border-radius: 16px; font-size: 15px; }
.p-line { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--sheet); border-radius: 12px; font-size: 14.5px; }
.p-line.off { opacity: .5; }
.p-scroll { overflow-x: auto; border-radius: 16px; background: var(--sheet); box-shadow: var(--shadow-sheet); }
.p-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.p-table th { text-align: left; font: 600 11.5px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-40); padding: 12px 10px 8px; white-space: nowrap; }
.p-table td { padding: 8px 10px; border-top: 1px solid var(--ink-07); vertical-align: middle; }
.p-table td small { display: block; color: var(--ink-55); font-size: 12.5px; }
.p-table select { min-width: 132px; padding: 7px 8px; font-size: 13.5px; }
.areas-pick { border: 1.5px dashed var(--ink-12); border-radius: 12px; padding: 10px 14px 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.areas-pick legend { font: 600 11.5px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-40); padding: 0 6px; }
.filters { gap: 6px; }
.d-stamp.bad { background: color-mix(in oklab, #D8394B 16%, var(--sheet)); }

#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 80; padding: 12px 18px 13px; border-radius: 14px; background: var(--ink); color: var(--table); font-size: 14.5px; font-weight: 650; box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s var(--ease); max-width: min(560px, calc(100vw - 30px)); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: #C22B3D; color: #fff; }

@media (max-width: 720px) {
  #panel { padding: 0; } .p-sheet { border-radius: 0; height: 100%; }
  .p-head { padding: 16px 16px 4px; } .p-tabs { padding: 8px 12px; } .p-body { padding: 6px 16px 24px; }
  #company-btn span { display: inline; } .f2 { flex-direction: column; align-items: stretch; }
}

/* ---------- workspace look, pictures, scenes ---------- */
#door { grid-template-columns: 1fr; place-items: center; overflow-y: auto; }
.door-btn.quiet { background: var(--ink-07); color: var(--ink); width: 100%; }
.door-sheet .mini { align-self: flex-start; }
.ws-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--btn); color: #fff; font-weight: 800; font-size: 15px; display: grid; place-items: center; overflow: hidden; flex: none; }
.ws-mark img { width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 96px; height: 64px; border-radius: 10px; background: var(--ink-07); display: grid; place-items: center; font-size: 11.5px; color: var(--ink-40); overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
textarea.prompt, textarea.code { font: 500 12.5px/1.5 var(--font-mono); background: var(--ink-07); border-color: transparent; }
textarea.prompt { font-family: var(--font-ui); font-size: 14px; }
.k-row { display: grid; grid-template-columns: 170px 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.f2.wrap { flex-wrap: wrap; } .f2.wrap .f { flex: 1 1 200px; }
input[type=color] { height: 42px; padding: 4px; }
.d-sec .door-dev { border-top: 0; padding-top: 0; }
.d-sec .door-dev input { height: 40px; }
.p-lead code { font: 500 12.5px var(--font-mono); background: var(--ink-07); padding: 2px 6px; border-radius: 6px; }
[data-scene] { cursor: pointer; }
@media (max-width: 720px) { .k-row { grid-template-columns: 1fr 1fr; } }

.ws-mark:has(img) { background: none; }

/* ---------- arranging a board, notices ---------- */
#bell { position: relative; }
#bell b, .ghost.theme b { position: absolute; top: -4px; right: -4px; font: 700 10.5px var(--font-mono); background: #D8394B; color: #fff; padding: 1px 5px; border-radius: 999px; }
#arrange-btn.on { background: var(--btn); color: #fff; }
body.arranging [data-id] { cursor: grab; }
body.arranging [data-list] { outline: 3px dashed var(--purple-line); outline-offset: 6px; border-radius: 12px; min-height: 64px; min-width: 120px; }
body.arranging .group.ghost { display: flex; }
.group.ghost { display: none; }
[data-list] > .add { align-self: center; justify-self: start; width: 54px; height: 54px; border-radius: 14px; background: var(--purple-tint); color: var(--btn); font-size: 34px; font-weight: 600; line-height: 1; flex: none; }
[data-list] > .add:hover { background: var(--btn); color: #fff; }
.lifting { opacity: .25; }
.ghost-drag { box-shadow: var(--shadow-float) !important; }
.drop-here { box-shadow: -10px 0 0 0 var(--btn) !important; }
.drop-list.drop-end { outline-style: solid; outline-color: var(--btn); }
#trash { position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 90px); z-index: 70; padding: 14px 26px; border-radius: 16px; background: var(--ink); color: var(--table); font-size: 14.5px; font-weight: 650; box-shadow: var(--shadow-float); transition: transform .18s var(--ease), background .15s; }
body.arranging #trash { transform: translate(-50%, 0); }
body.arranging #legend, body.arranging #hint { opacity: 0; pointer-events: none; }
#trash.hot { background: #C22B3D; color: #fff; }
.notice { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--sheet); box-shadow: 0 0 0 1px var(--ink-12); font-size: 14.5px; line-height: 1.4; width: 100%; }
.notice:hover { box-shadow: 0 0 0 1.5px var(--btn); }
.notice .st { margin-top: 4px; flex: none; }
.notice b { display: block; } .notice time { display: block; font: 500 12px var(--font-mono); color: var(--ink-40); }
#pick-q { margin-bottom: 4px; }

/* the choice of a summary by e-mail, under the list of notices */
.check.digest { margin-top: 18px; white-space: normal; align-items: flex-start; }
.check.digest > span { font-weight: 500 !important; color: var(--ink-2, var(--ink)) !important; }
