/* Owner editor interface. Based on the look of the local candidate in ../integrated/editor.html. */
:root{color-scheme:light;--ink:#282125;--muted:#685a61;--line:#e4dadd;--bg:#f5f0eb;--paper:#fffdfa;--wine:#653e54;--dark:#30252d;--accent:#eed7bf;font:15px/1.45 system-ui,sans-serif;color:var(--ink);background:var(--bg)}
*{box-sizing:border-box}
body{margin:0;min-width:280px}
button,input,select,textarea{font:inherit}
input,select,textarea{width:100%;min-width:0;background:#fffdfa;border:1px solid #bfb1b8;border-radius:7px;padding:.55rem .65rem;color:inherit}
textarea{resize:vertical;min-height:4.5rem}
button{background:var(--paper);color:inherit;border:1px solid #bcacb4;border-radius:7px;padding:.48rem .7rem;cursor:pointer;min-height:38px}
button:hover{background:#eee4e7}
button:disabled{cursor:default;opacity:.52}
button.primary{background:var(--wine);color:#fff;border-color:var(--wine)}
button.primary:hover{background:#522e46}
button.danger{color:#7d3548}
button[aria-pressed="true"]{background:#f4dcc4;color:#38242e;border-color:#f4dcc4}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,a:focus-visible{outline:2px solid #9a517d;outline-offset:3px}
label{display:grid;gap:.32rem;margin-block:.65rem;font-weight:600;font-size:.86rem}
small,.quiet{color:var(--muted)}
.small{font-size:.82rem}
[hidden]{display:none!important}
.wrap{min-height:100dvh}
.auth-shell{min-height:100dvh;display:grid;place-items:center;padding:24px;background:radial-gradient(ellipse at top left,#d9bbc7 0,transparent 60%),linear-gradient(140deg,#f4ece0,#ede1e3)}
.auth{width:min(100%,440px);background:var(--paper);border:1px solid #e0d3d9;border-radius:16px;box-shadow:0 18px 50px #452e3b1a;padding:clamp(1.3rem,5vw,2.6rem)}
.auth h1{font:2.15rem/1.03 Georgia,serif;margin:1rem 0}
.auth input{min-height:44px}
.auth button{margin-top:.5rem;width:100%;min-height:46px}
.badge{display:grid;place-items:center;border-radius:50%;background:var(--dark);color:#f5e4d1;width:43px;height:43px;font:1.1rem Georgia,serif;flex-shrink:0}
.top{background:var(--dark);color:#fff9f3;display:flex;align-items:center;gap:1rem;justify-content:space-between;padding:12px 18px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:.7rem}
.top .badge{background:#eee0d2;color:#372831;width:38px;height:38px}
.brand strong{font:1.18rem Georgia,serif;display:block}
.brand small{color:#e4cbd9;font-size:.72rem}
.button-row{display:flex;gap:.45rem;flex-wrap:wrap;align-items:center}
.top .primary{color:#38242e;background:#f4dcc4;border-color:#f4dcc4}
.top .primary:hover{background:#f4ede5}
.top .secondary{background:transparent;color:#fff9f3;border-color:#8c747f}
.top .secondary:hover{background:#4d3945}
.top .secondary[aria-pressed="true"]{background:#f4dcc4;color:#38242e}
.stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,360px);height:calc(100dvh - 65px)}
.view{display:flex;flex-direction:column;min-width:0;min-height:0;padding:.75rem;gap:.65rem}
.viewbar{display:grid;grid-template-columns:minmax(180px,440px) 1fr;align-items:end;gap:.6rem}
.viewbar label{margin:0}
.viewbar .button-row{justify-content:flex-end}
.linkish{color:var(--wine);font-weight:600;font-size:.86rem;padding:.45rem .2rem}
.notice{margin:0;padding:.55rem .7rem;border-radius:8px;background:#fbf1dc;border:1px solid #ecd9ae;font-size:.88rem}
.screen{position:relative;min-height:0;flex:1;background:#eadfe3;border:1px solid #d6c7cf;border-radius:10px;overflow:hidden}
.canvas{position:absolute;top:0;left:0;width:100%;height:100%;border:0;background:#fff;visibility:hidden;transform-origin:0 0}
.canvas.is-front{visibility:visible}
.screen.phone .canvas{box-shadow:0 0 24px #49304723}
.side{background:var(--paper);border-left:1px solid var(--line);min-height:0;overflow:auto;padding:1rem}
.side h1{font:1.55rem Georgia,serif;margin:0 0 .35rem}
.side p{margin:.45rem 0}
.side details{border-top:1px solid var(--line);padding:.7rem 0}
.side summary{font-weight:650;cursor:pointer;min-height:28px}
.selection{display:grid;gap:.35rem;color:var(--muted);background:#f5edf1;border-radius:8px;padding:.55rem .68rem;margin:.6rem 0;font-size:.84rem}
.crumbs{display:flex;flex-wrap:wrap;gap:.3rem;margin:.4rem 0}
.crumbs button{min-height:28px;padding:.15rem .5rem;font-size:.78rem;border-radius:999px}
.status{min-height:1.45em;font-size:.86rem;color:#753b5b;font-weight:550;overflow-wrap:anywhere}
.status[data-error="true"]{color:#86253f}
/* The message line of the editing panel stays in view while the panel is scrolled, so a refusal is never missed.
   A sticky line is measured from inside the panel's 1rem of padding: -1rem puts it flush with the panel's top edge,
   so nothing shows above it. On narrower screens the page itself scrolls, and the line is measured from the screen. */
#status:not(:empty){position:sticky;top:-1rem;z-index:2;background:var(--paper);margin:0 -1rem;padding:.4rem 1rem;box-shadow:0 7px 8px -8px #38202d59}
.paths{font:.8rem ui-monospace,monospace;color:var(--muted);overflow-wrap:anywhere}
.pairs{display:grid;grid-template-columns:1fr 1fr;gap:.55rem}
.pairs label{min-width:0}
.readonly{padding:.7rem;border:1px solid var(--line);border-radius:7px;background:#f7f1e8;margin:.6rem 0;font-size:.88rem}
.readonly ul{margin:.4rem 0 .4rem 1.1rem;padding:0}
dialog{width:min(92vw,520px);max-height:88dvh;overflow:auto;background:var(--paper);color:inherit;border:1px solid #d4bac9;border-radius:13px;padding:1.25rem;box-shadow:0 20px 60px #38202d36}
dialog::backdrop{background:#30252dbd}
dialog h2{font:1.5rem Georgia,serif;margin-top:0}
dialog h3{font-size:.95rem;margin:1rem 0 .3rem}
dialog label{margin:1rem 0}
dialog .button-row{margin-top:.9rem}
.history{list-style:none;margin:0;padding:0;display:grid;gap:.5rem}
.history li{border:1px solid var(--line);border-radius:9px;padding:.6rem .7rem;display:grid;gap:.35rem}
.history .when{font-size:.8rem;color:var(--muted)}
.history .live{color:#2d6a4f;font-weight:650;font-size:.8rem}
.library{display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:.5rem;margin:.7rem 0}
.library button{padding:0;overflow:hidden;aspect-ratio:1;display:grid;place-items:center;background:#f1e8ec}
.library img{width:100%;height:100%;object-fit:cover;display:block}
.library .wide{grid-column:1/-1;margin:0}
.color-row{display:grid;grid-template-columns:38px minmax(0,1fr);gap:.35rem;align-items:stretch}
.color-row input[type=color]{padding:2px;min-height:0;height:auto;width:38px;cursor:pointer}
.hint{margin:.2rem 0 .5rem;color:var(--muted);font-size:.8rem}
.to-canvas{display:none}
@media(max-width:870px){.stage{height:auto;min-height:calc(100dvh - 115px);grid-template-columns:minmax(0,1fr) 300px}.viewbar{grid-template-columns:1fr}.viewbar .button-row{justify-content:flex-start}.side{overflow:visible}#status:not(:empty){top:0}}
@media(max-width:680px){.stage{grid-template-columns:1fr}.screen{height:58dvh;flex:none}.side{border-left:0;border-top:1px solid var(--line)}.top .button-row{width:100%}.top button{flex:1 1 auto}.to-canvas{display:block;position:sticky;top:8px;z-index:3;margin:0 0 .4rem auto;box-shadow:0 2px 10px #49304733}#editingControls{scroll-margin-top:8px}#status:not(:empty){top:50px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
