/* Solo Web — Simple Mode pilot, session edition. Fresh-produce palette, deliberately not-Teams. */
:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --side: #eef1ec;
  --ink: #1d2b22;
  --ink-soft: #5b6b60;
  --line: #e3e7e0;
  --green: #2e7d4f;
  --green-deep: #1f5c3a;
  --green-soft: #e8f3ec;
  --user-bubble: #dff0e6;
  --danger: #b3402f;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a15; --panel: #1b241e; --side: #171f19; --ink: #e7efe9;
    --ink-soft: #9cab9f; --line: #2a352d; --green: #4caf7d; --green-deep: #7ccfa4;
    --green-soft: #21382b; --user-bubble: #234634; --danger: #e07b6a;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 18px/1.6 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
#app { display: flex; height: 100dvh; }

/* ================= sidebar ================= */
#side {
  width: var(--side-w, 264px); flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line);
  transition: margin-left .2s ease; position: relative;
}
/* drag handle: sits on the sidebar's right edge */
#sideGrip {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 30; background: transparent;
}
#sideGrip:hover, #sideGrip.dragging { background: color-mix(in srgb, var(--green) 45%, transparent); }
body.resizing { cursor: col-resize; user-select: none; }
@media (max-width: 820px) { #sideGrip { display: none; } }
#app.side-hidden #side { margin-left: -264px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
  color: #fff; font-weight: 800; font-size: 19px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12.5px; color: var(--ink-soft); }
.icon-btn {
  background: none; border: none; color: var(--ink-soft); font-size: 17px;
  cursor: pointer; padding: 5px 9px; border-radius: 8px;
}
.icon-btn:hover { background: var(--green-soft); color: var(--green); }

.new-chat {
  margin: 4px 12px 10px; padding: 10px 12px; display: flex; align-items: center; gap: 8px;
  background: var(--green); color: #fff; border: none; border-radius: 11px;
  font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.new-chat:hover { background: var(--green-deep); }
.new-chat span { font-size: 16px; line-height: 1; }

#sessionList { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.sess-group { font-size: 13.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-soft); padding: 12px 8px 5px; }
.sess {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 8px 10px; border: none; background: none; border-radius: 9px;
  color: var(--ink); font-size: 15px; cursor: pointer; text-align: left;
}
.sess:hover { background: var(--green-soft); }
.sess.active { background: var(--green-soft); font-weight: 600; color: var(--green-deep); }
.sess .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess .del {
  visibility: hidden; border: none; background: none; color: var(--ink-soft);
  cursor: pointer; font-size: 14.5px; padding: 2px 5px; border-radius: 6px;
}
.sess:hover .del { visibility: visible; }
.sess .del:hover { color: var(--danger); }
.sess-empty { padding: 14px 10px; font-size: 14px; color: var(--ink-soft); }

.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; position: relative; }
.user-pop {
  position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px; z-index: 40;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(10, 20, 14, .25); padding: 12px 14px; font-size: 14.5px;
}
.up-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.up-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.up-label { color: var(--ink-soft); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: none; background: none; color: var(--ink); padding: 4px 10px; cursor: pointer; font-size: 14px; }
.seg button:nth-child(1) { font-size: 12.5px; } .seg button:nth-child(3) { font-size: 15.5px; }
.seg button.on { background: var(--green); color: #fff; }
.swatches { display: inline-flex; gap: 6px; }
.sw { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.sw.on { border-color: var(--ink); }
.sw-default { background: var(--green-deep); }
.up-div { border-top: 1px solid var(--line); margin: 10px -14px 6px; }
.up-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: none;
  background: none; color: var(--ink); border-radius: 9px; cursor: pointer; font-size: 14.5px; text-align: left; }
.up-item:hover { background: var(--green-soft); }
.up-hint { margin-left: auto; color: var(--ink-soft); font-size: 12.5px; }
.user-badge {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 9px;
  background: none; border: none; border-radius: 10px; cursor: pointer;
  color: var(--ink); font-size: 17px; font-weight: 600;
}
.user-badge:hover { background: var(--green-soft); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--user-accent, var(--green-deep)); color: #fff; font-size: 15.5px; font-weight: 700;
}

/* ================= main ================= */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel);
}
#menuBtn { display: none; }
#chatTitle { font-weight: 650; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#chat { flex: 1; overflow-y: auto; padding: 22px 20px 10px; scroll-behavior: smooth; }
.chat-inner { max-width: min(1400px, 94%); margin: 0 auto; }

#welcome { text-align: center; margin-top: 8vh; }
.w-mark {
  margin: 0 auto 18px; width: 56px; height: 56px; font-size: 30px; border-radius: 16px;
  display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--green-deep));
}
#welcome h1 { font-size: 21px; font-weight: 650; margin: 0 0 6px; }
.w-hint { color: var(--ink-soft); margin: 0 0 22px; font-size: 15.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; max-width: 560px; margin: 0 auto; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 15px; font-size: 14.5px; cursor: pointer;
}
.chip:hover { border-color: var(--green); background: var(--green-soft); }

.msg { display: flex; margin: 0 0 16px; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 11px 15px; font-size: var(--chat-fs, 15px); border-radius: var(--radius); overflow-wrap: break-word; position: relative; }
.msg.user .bubble { background: var(--user-accent-soft, var(--user-bubble)); border-bottom-right-radius: 5px; max-width: 78%; }
.msg.solo .bubble { background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.solo .who { font-size: 13px; font-weight: 700; color: var(--green); margin-bottom: 3px; letter-spacing: .3px; }
.bubble img.shot { max-width: 100%; border-radius: 8px; display: block; margin-top: 6px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin-bottom: 0; }
.bubble ol, .bubble ul { margin: 4px 0 8px; padding-left: 22px; }
.bubble li { margin: 3px 0; }
.bubble code { font-family: var(--mono); font-size: 14.5px; background: var(--green-soft); padding: 1px 5px; border-radius: 5px; }
.bubble pre { background: var(--green-soft); padding: 10px 12px; border-radius: 9px; overflow-x: auto; font-family: var(--mono); font-size: 14.5px; }
.bubble pre code { background: none; padding: 0; }
.bubble table { border-collapse: collapse; margin: 6px 0; font-size: 15px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.bubble th { background: var(--green-soft); }
.source { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 14px; color: var(--ink-soft); }
.source b { color: var(--green); font-weight: 650; }
.stamp { font-size: 13px; color: var(--ink-soft); font-style: italic; margin-top: 7px; }
.copy-btn {
  position: absolute; top: 7px; right: 8px; border: none; background: none;
  color: var(--ink-soft); cursor: pointer; font-size: 13.5px; padding: 3px 6px;
  border-radius: 6px; opacity: 0; transition: opacity .12s;
}
.msg.solo .bubble:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--green-soft); color: var(--green); }

.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: blink 1.2s infinite; opacity: .3; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 40% { opacity: 1; } }
.error-bubble { color: var(--danger); font-size: 15px; }

/* ================= composer ================= */
#composer { background: var(--panel); border-top: 1px solid var(--line); padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); }
#composer > div { max-width: min(1400px, 94%); margin-left: auto; margin-right: auto; }
#attachStrip { display: flex; gap: 8px; }
#attachStrip .thumb { position: relative; margin-bottom: 8px; }
#attachStrip img { height: 54px; border-radius: 8px; border: 1px solid var(--line); }
#attachStrip .x {
  position: absolute; top: -6px; right: -6px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--ink); color: var(--bg); border: none; font-size: 12.5px; cursor: pointer; line-height: 1;
}
#inputRow { display: flex; align-items: flex-end; gap: 12px; }
#input {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--bg); color: var(--ink); padding: 16px 18px; font: inherit;
  font-size: 18px; line-height: 1.5; min-height: 30px; max-height: 260px; outline: none;
}
#input:focus { border-color: var(--green); }
#sendBtn {
  width: 54px; height: 54px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--green); color: #fff; display: grid; place-items: center; transition: opacity .15s;
}
#sendBtn:disabled { opacity: .35; cursor: default; }
#footNote { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin-top: 7px; }

/* ================= who dialog ================= */
dialog {
  border: none; border-radius: 16px; padding: 26px 28px; max-width: 320px; width: 90vw;
  background: var(--panel); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
dialog::backdrop { background: rgba(10, 20, 14, .45); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 4px; font-size: 18px; }
dialog p { margin: 0 0 16px; font-size: 14.5px; color: var(--ink-soft); }
#whoList { display: grid; gap: 8px; margin-bottom: 12px; }
#whoList button {
  padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
  color: var(--ink); font-size: 15.5px; cursor: pointer; text-align: left;
}
#whoList button:hover { border-color: var(--green); background: var(--green-soft); }
#whoOther, #whoPass {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; margin-bottom: 12px;
}
button.primary {
  width: 100%; padding: 11px; border: none; border-radius: 10px; cursor: pointer;
  background: var(--green); color: #fff; font-size: 16px; font-weight: 600;
}

/* ================= mobile ================= */
@media (max-width: 760px) {
  #side {
    position: fixed; z-index: 20; height: 100dvh; box-shadow: 4px 0 24px rgba(0,0,0,.18);
    margin-left: -264px;
  }
  #app.side-open #side { margin-left: 0; }
  #app.side-hidden #side { margin-left: -264px; }
  #menuBtn { display: block; }
  #collapseBtn { display: block; }
  .bubble { max-width: 90%; }
}
@media (min-width: 761px) { #collapseBtn { display: block; } }

/* ================= live status (streaming) ================= */
.live .status-line { font-size: 14.5px; color: var(--green); font-weight: 600; margin-top: 4px; }
.status-trail { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; }
.trail-item { font-size: 13px; color: var(--ink-soft); }

/* ================= stepper ================= */
.steps { border: 1px solid var(--line); border-radius: 11px; margin: 8px 0; overflow: hidden; }
.steps-head {
  display: flex; justify-content: flex-end; padding: 6px 12px;
  background: var(--green-soft); border-bottom: 1px solid var(--line);
}
.steps-count { font-size: 13px; font-weight: 700; color: var(--green); letter-spacing: .3px; }
.steps.all-done .steps-head { background: var(--green); }
.steps.all-done .steps-count { color: #fff; }
.step-list { list-style: none; margin: 0 !important; padding: 4px 0 !important; counter-reset: step; }
.step-list li {
  counter-increment: step; position: relative; padding: 8px 14px 8px 46px !important;
  margin: 0 !important; cursor: pointer; transition: background .12s;
}
.step-list li:hover { background: var(--green-soft); }
.step-list li::before {
  content: counter(step); position: absolute; left: 12px; top: 7px;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--green); color: var(--green); font-size: 13.5px; font-weight: 700;
}
.step-list li.done { color: var(--ink-soft); text-decoration: line-through; }
.step-list li.done::before { content: "✓"; background: var(--green); color: #fff; }

/* ================= lightbox ================= */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 10, .88);
  display: grid; place-items: center; cursor: zoom-out; animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.lightbox img {
  max-width: 92vw; max-height: 88vh; border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: transform .15s;
}
.lightbox img.zoomed { transform: scale(1.8); cursor: zoom-in; }
.lb-hint { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center;
  color: #cfe3d6; font-size: 13.5px; }
#chat img { cursor: zoom-in; }

/* ================= table stakes (v3) ================= */
.ts {
  display: block; font-size: 10.5px; color: var(--ink-soft); margin-top: 6px;
  opacity: 0; transition: opacity .15s; text-align: right;
}
.bubble:hover .ts { opacity: .8; }
.action-bar {
  display: flex; gap: 4px; align-items: center; margin-top: 8px;
  opacity: 0; transition: opacity .15s;
}
.msg.solo .bubble:hover .action-bar { opacity: 1; }
.act {
  border: none; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: 13.5px; padding: 3px 7px; border-radius: 6px;
}
.act:hover { background: var(--green-soft); color: var(--green); }
.act.voted { background: var(--green-soft); color: var(--green); opacity: 1; }
.copy-btn { display: none; }             /* superseded by the action bar */
.edit-btn {
  position: absolute; top: 6px; left: -28px; border: none; background: none;
  color: var(--ink-soft); cursor: pointer; font-size: 14.5px; padding: 3px 6px;
  border-radius: 6px; opacity: 0; transition: opacity .12s;
}
.msg.user .bubble:hover .edit-btn { opacity: 1; }
.edit-btn:hover { color: var(--green); background: var(--green-soft); }
#sendBtn.stop { background: var(--danger); }
#renameBtn { font-size: 14.5px; }

/* ================= correction box (thumbs-down flow) ================= */
.fix-box {
  margin-top: 9px; padding: 10px 12px; border: 1px dashed var(--green);
  border-radius: 10px; background: var(--green-soft); animation: rise .18s ease-out;
}
.fix-label { font-size: 14px; color: var(--ink); margin-bottom: 7px; }
.fix-done { color: var(--green); font-weight: 600; margin-bottom: 0; }
.fix-text {
  width: 100%; resize: vertical; border: 1.5px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); padding: 7px 10px; font: inherit;
  font-size: 15px; outline: none;
}
.fix-text:focus { border-color: var(--green); }
.fix-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.fix-skip {
  border: none; background: none; color: var(--ink-soft); cursor: pointer;
  font-size: 14px; padding: 5px 9px; border-radius: 7px;
}
.fix-send {
  border: none; background: var(--green); color: #fff; cursor: pointer;
  font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 7px;
}
.fix-send:hover { background: var(--green-deep); }

/* ================= document pane (v6) ================= */
#docPane {
  width: 0; flex-shrink: 0; overflow: hidden; background: var(--panel);
  border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transition: width .22s ease;
}
#app.doc-open #docPane { width: 400px; }
.dp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 360px;
}
#dpTitle { font-weight: 650; font-size: 15px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.dp-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#dpOpen { font-size: 13.5px; color: var(--green); text-decoration: none; font-weight: 600; }
#dpOpen:hover { text-decoration: underline; }
#dpBody { flex: 1; overflow-y: auto; padding: 12px; min-width: 360px; }
.dp-count { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.dp-img {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px;
  cursor: zoom-in; display: block; background: #fff;
}
.dp-pdf { width: 100%; height: 100%; min-height: 70vh; border: none; border-radius: 8px; }
.dp-empty { color: var(--ink-soft); font-size: 14.5px; padding: 18px 6px; }
.doc-view {
  border: 1px solid var(--green); background: none; color: var(--green); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px;
}
.doc-view:hover { background: var(--green-soft); }
@media (max-width: 1100px) {
  #app.doc-open #docPane { position: fixed; right: 0; top: 0; height: 100dvh; width: min(420px, 96vw);
    z-index: 30; box-shadow: -6px 0 28px rgba(0,0,0,.25); }
}

/* ================= produce identity (v7) ================= */
/* The market-awning stripe: leaf, lime, citrus, tomato, eggplant. Thin = classy. */
#side .side-head { position: relative; }
#app::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60;
  background: linear-gradient(90deg,
    #1f5c3a 0 22%, #2e7d4f 22% 42%, #7cb342 42% 60%,
    #f0a92e 60% 74%, #e05b45 74% 88%, #7b4fa0 88% 100%);
}

/* Leaf sprout on the brand mark */
.brand-mark, .w-mark { position: relative; overflow: visible; }
.brand-mark::after, .w-mark::after {
  content: ""; position: absolute; top: -7px; right: -6px; width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20 Q4 6 20 4 Q20 18 8 20 Q6 20 4 20Z' fill='%237cb342'/%3E%3Cpath d='M4 20 Q10 12 18 6' stroke='%232e7d4f' stroke-width='1.4' fill='none'/%3E%3C/svg%3E")
    no-repeat center / contain;
  transform: rotate(12deg);
}
.w-mark::after { width: 24px; height: 24px; top: -10px; right: -9px; }

/* Typing dots ripen: leaf -> citrus -> tomato */
.typing i:nth-child(1) { background: #2e7d4f; }
.typing i:nth-child(2) { background: #f0a92e; }
.typing i:nth-child(3) { background: #e05b45; }

/* Faint leaf field behind the conversation — texture, not wallpaper */
#chat {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340' viewBox='0 0 340 340'%3E%3Cg fill='none' stroke='%232e7d4f' stroke-opacity='0.05' stroke-width='1.6'%3E%3Cpath d='M40 60 Q40 30 70 26 Q70 54 48 60Z'/%3E%3Cpath d='M240 130 Q240 100 270 96 Q270 124 248 130Z' transform='rotate(40 255 113)'/%3E%3Cpath d='M110 250 Q110 220 140 216 Q140 244 118 250Z' transform='rotate(-25 125 233)'/%3E%3Cpath d='M290 290 Q290 260 320 256 Q320 284 298 290Z' transform='rotate(15 305 273)'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  #chat {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='340' height='340' viewBox='0 0 340 340'%3E%3Cg fill='none' stroke='%234caf7d' stroke-opacity='0.06' stroke-width='1.6'%3E%3Cpath d='M40 60 Q40 30 70 26 Q70 54 48 60Z'/%3E%3Cpath d='M240 130 Q240 100 270 96 Q270 124 248 130Z' transform='rotate(40 255 113)'/%3E%3Cpath d='M110 250 Q110 220 140 216 Q140 244 118 250Z' transform='rotate(-25 125 233)'/%3E%3Cpath d='M290 290 Q290 260 320 256 Q320 284 298 290Z' transform='rotate(15 305 273)'/%3E%3C/g%3E%3C/svg%3E");
  }
}

/* Welcome mark grows the full leaf treatment */
#welcome h1 { letter-spacing: -.2px; }
.chips .chip { transition: transform .1s, border-color .15s, background .15s; }
.chips .chip:hover { transform: translateY(-1px); }

/* Session hover gets the tiniest leaf tick */
.sess.active .t::before { content: "🌱 "; font-size: 12.5px; }

/* ================= search + export (v8) ================= */
#searchWrap { padding: 0 12px 8px; }
#searchBox {
  width: 100%; padding: 7px 11px; border: 1.5px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 14.5px; outline: none;
}
#searchBox:focus { border-color: var(--green); }
#topbar { gap: 6px; }

/* ================= touch devices: no hover, so show the controls (v12) ================= */
@media (hover: none) {
  .action-bar { opacity: 1 !important; flex-wrap: wrap; gap: 2px; }
  .act { padding: 7px 11px; font-size: 14.5px; }          /* finger-sized targets */
  .ts { opacity: .65 !important; }
  .edit-btn {
    position: static; opacity: 1 !important; display: inline-block;
    margin-top: 6px; padding: 5px 9px; font-size: 13.5px;
    border: 1px solid var(--line); border-radius: 7px;
  }
  .msg.user .bubble { padding-bottom: 8px; }
  .doc-view { padding: 5px 11px; font-size: 14px; }   /* tappable document pill */
  .step-list li { padding-top: 11px !important; padding-bottom: 11px !important; }
}

/* admin link in the sidebar footer */
.admin-link {
  display: block; width: 100%; text-align: left; font-size: 16.5px; color: var(--ink);
  text-decoration: none; background: none; border: none; cursor: pointer;
  padding: 9px 10px; border-radius: 9px; margin-bottom: 4px; font-family: inherit;
}
.admin-link:hover { background: var(--green-soft); color: var(--green); }

/* the topbar toggle is ALWAYS available — it is the only way back from a collapsed
   sidebar (bug 2026-07-29: collapse hid its own undo). */
#menuBtn { display: block !important; }
#app.side-hidden #collapseBtn { display: none; }
#menuBtn::after { content: ""; }

/* ================= what's new (v17) ================= */
.news-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-left: 6px; vertical-align: middle;
}
.news-day {
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink-soft); padding: 12px 2px 6px;
}
.news-item {
  display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px;
  font-size: 15px; background: var(--bg);
}
.news-ico { flex-shrink: 0; font-weight: 800; }
.news-item.fixed .news-ico { color: var(--green); }
.news-item.added .news-ico { color: var(--amber, #b97c19); }

/* ================= file drop + confidence (v18) ================= */
#attachBtn {
  width: 54px; height: 54px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-soft); font-size: 21px; cursor: pointer;
}
#attachBtn:hover { border-color: var(--green); color: var(--green); }
.doc-chip, .file-chip {
  display: inline-flex; align-items: center; gap: 5px; background: var(--green-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 14px; font-weight: 600; margin: 2px 4px 2px 0;
}
.doc-thumb { display: flex; align-items: center; }
.thin-note {
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line);
  font-size: 13.5px; font-style: italic; color: var(--amber, #b97c19);
}

/* ================= pins, notes, theme override (v19) ================= */
/* manual theme override: data-theme wins over the OS preference */
:root[data-theme="light"] {
  --bg: #f6f7f4; --panel: #ffffff; --side: #eef1ec; --ink: #1d2b22;
  --ink-soft: #5b6b60; --line: #e3e7e0; --green: #2e7d4f; --green-deep: #1f5c3a;
  --green-soft: #e8f3ec; --user-bubble: #dff0e6; --danger: #b3402f; --amber: #b97c19;
}
:root[data-theme="dark"] {
  --bg: #131a15; --panel: #1b241e; --side: #171f19; --ink: #e7efe9;
  --ink-soft: #9cab9f; --line: #2a352d; --green: #4caf7d; --green-deep: #7ccfa4;
  --green-soft: #21382b; --user-bubble: #234634; --danger: #e07b6a; --amber: #d9a441;
}
.pin-item .t::before { content: ""; }
.pin-item { font-style: italic; }
.notes-area {
  width: 100%; min-height: 60vh; resize: vertical; border: 1.5px solid var(--line);
  border-radius: 11px; background: var(--bg); color: var(--ink); padding: 12px 14px;
  font: inherit; font-size: 15.5px; line-height: 1.6; outline: none;
}
.notes-area:focus { border-color: var(--green); }
.w-sub { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); }

.taken-row { display: flex; gap: 8px; margin-top: 8px; }
.taken-row button { flex: 1; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; }
.taken-row button.primary { background: var(--green); border-color: var(--green); color: #fff; }

.ms-auth { border: none; border-radius: 12px; padding: 26px 28px 20px; width: min(92vw, 380px);
  background: var(--panel); color: var(--ink); box-shadow: 0 18px 60px rgba(0,0,0,.35); text-align: center; }
.ms-auth .ms-head { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.ms-auth h2 { margin: 0 0 4px; font-size: 19px; }
.ms-auth .sub { margin: 0 0 12px; }
.ms-auth input { width: 100%; box-sizing: border-box; padding: 10px 12px; margin: 6px 0 4px;
  border: 1.5px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font: inherit; }
.ms-btns { display: flex; gap: 10px; margin-top: 12px; }
.ms-btns button { flex: 1; padding: 10px 0; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.ms-btns button.primary { background: var(--green); border-color: var(--green); color: #fff; }


/* ── produce-house identity ─────────────────────────────────────────────
   We are a produce company: the market awning across the top, crate-slat
   texture behind the sidebar, and a harvest palette for the accents. */
#side {
  background-image: repeating-linear-gradient(
    180deg, transparent 0 38px,
    color-mix(in srgb, var(--ink) 3%, transparent) 38px 39px);
}
.side-head { position: relative; }
.side-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: repeating-linear-gradient(90deg,
    #3f8f4f 0 26px, #7cb342 26px 52px, #d4a017 52px 78px,
    #e07b39 78px 104px, #c0392b 104px 130px);
  opacity: .55; border-radius: 2px;
}
#welcome .w-mark {
  background: linear-gradient(160deg, #4c9a5a, #2e7d32 60%, #256428);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--green) 30%, transparent);
}
.sess.active { border-left: 3px solid var(--green); }
.chip { border-radius: 999px; }

.guide-page { border: 1px solid var(--line); background: var(--green-soft); color: var(--green);
  border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 15px; cursor: pointer; margin: 0 2px; }
.guide-page:hover { border-color: var(--green); }
.dp-shot { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; margin: 0 0 12px; }

#micBtn {
  width: 54px; height: 54px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink-soft); font-size: 21px; cursor: pointer;
}
#micBtn:hover { border-color: var(--green); color: var(--green); }
#micBtn.listening { background: var(--green); border-color: var(--green); color: #fff;
  animation: micpulse 1.1s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--green) 22%, transparent); } }
#micBtn[hidden] { display: none; }
.speak-btn.on { background: var(--green-soft); color: var(--green); }
.voice-note { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }

/* guide screenshots, inline in the conversation */
.guide-shots { margin: 10px 0 4px; }
.gs-note { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 6px; }
.guide-shot {
  display: block; width: 100%; max-width: 100%; border: 1px solid var(--line);
  border-radius: 10px; margin: 0 0 10px; cursor: zoom-in; background: #fff;
}
.guide-page.open { background: var(--green); color: #fff; border-color: var(--green); }
/* zoomable viewer */
.lightbox { position: fixed; inset: 0; background: rgba(8,14,10,.92); z-index: 90;
  display: flex; flex-direction: column; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: rgba(0,0,0,.35); color: #fff; flex-wrap: wrap; }
.lb-bar button { background: rgba(255,255,255,.12); color: #fff; border: none;
  border-radius: 8px; padding: 7px 13px; font: inherit; font-size: 16px; cursor: pointer; }
.lb-bar button:hover { background: rgba(255,255,255,.24); }
.lb-pct { color: #fff; font-size: 15px; min-width: 58px; text-align: center; }
.lb-open { color: #9fe6b0; font-size: 15px; margin-left: auto; text-decoration: none; }
.lb-stage { flex: 1; overflow: hidden; display: grid; place-items: center; }
.lb-stage img { max-width: 96%; max-height: 100%; transform-origin: center center;
  transition: transform .06s linear; background: #fff; border-radius: 6px; }
.lb-hint { text-align: center; color: rgba(255,255,255,.6); font-size: 13.5px; padding: 8px; }

.act.speak.on { background: var(--green); color: #fff; }
.voice-pick { display: inline-flex; gap: 6px; align-items: center; }
#voicePick { max-width: 165px; background: var(--bg); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 7px; font: inherit; font-size: 13.5px; }
#voiceTest { background: var(--green-soft); color: var(--green); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 14px; }
