/* Lorenzo: Lulo Libros team help desk. Brand colours and fonts from the Lulo storefront (Lucía v6). */
:root{
  --coral:#E06A60; --coral-deep:#C9554C; --coral-bg:#FCEBE9;
  --mint:#E3F1DC; --mint-deep:#CDE6C4; --mint-soft:#F2F8EE;
  --green:#57A64B; --leaf:#A3CC87; --forest:#2E6B3C; --forest-deep:#245731; --ink:#233A2A;
  --sun:#F3C93F; --sun-bg:#FDF4D3; --white:#FFFFFF; --line:#E8E3D8; --line-2:#D9D3C6; --paper:#FBFAF6;
  --muted:#5F6F5B; --amber:#9A6412; --amber-bg:#FFF4DE; --amber-line:#F1DDB4;
  --blue:#2F5E94; --blue-bg:#E7F0FB; --gray-bg:#EEF0EA; --gray:#5E6B5A;
  --bad:#8A2F2F; --bad-bg:#FBEAEA; --bad-line:#E7BFBF;
  --radius:14px; --radius-sm:9px;
  --shadow:0 1px 2px rgba(35,58,42,.05), 0 4px 14px rgba(35,58,42,.06);
  --shadow-lg:0 18px 50px rgba(25,40,20,.22);
  --side:252px;
  --font:'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display:'Baloo 2', 'Poppins', system-ui, sans-serif;
}
*{box-sizing:border-box;}
html{-webkit-text-size-adjust:100%;}
body{margin:0; font-family:var(--font); font-size:15px; line-height:1.55; color:var(--ink); background:var(--paper);}
img{max-width:100%;}
h1,h2,h3,h4{font-family:var(--display); color:var(--ink); line-height:1.15; margin:0;}
h1{font-size:34px; font-weight:800; letter-spacing:-.01em;}
h2{font-size:20px; font-weight:700;}
h3{font-size:16px; font-weight:700;}
p{margin:0 0 10px;}
a{color:var(--forest);}
a:hover{color:var(--forest-deep);}
button,input,select,textarea{font:inherit; color:inherit;}
:focus-visible{outline:3px solid var(--sun); outline-offset:2px; border-radius:6px;}
[tabindex="-1"]:focus{outline:none;}
[hidden]{display:none !important;}
.sr-only{position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;}
.skip{position:absolute; left:-9999px; top:8px; z-index:500; background:var(--ink); color:#fff; padding:10px 16px; border-radius:8px;}
.skip:focus{left:12px;}
.muted{color:var(--muted);}
.small{font-size:13px;}
.block{display:block;}
.grow{flex:1; min-width:0;}
.mono{font-variant-numeric:tabular-nums; letter-spacing:.01em; white-space:nowrap;}
.warn-txt{color:var(--amber); font-weight:600;}
.ok-txt{color:var(--forest); font-weight:600; display:inline-flex; align-items:center; gap:6px;}
.pre{white-space:pre-wrap;}
.ic{width:20px; height:20px; flex:none; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; vertical-align:-4px;}

/* ---------- shell ---------- */
.app{min-height:100vh;}
.side{position:fixed; inset:0 auto 0 0; width:var(--side); background:var(--white); border-right:1px solid var(--line);
  display:flex; flex-direction:column; padding:18px 14px 14px; z-index:60; overflow-y:auto;}
.brand{display:flex; align-items:center; gap:11px; text-decoration:none; color:var(--ink); padding:2px 8px 18px;}
.brand img{border-radius:8px; flex:none;}
.brand-name{display:block; font-family:var(--display); font-weight:800; font-size:27px; line-height:1; color:var(--forest);}
.brand-tag{display:block; font-size:12px; color:var(--muted); line-height:1.3; margin-top:3px;}
.nav{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:3px;}
.nav a{display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:11px; text-decoration:none; color:var(--ink);
  font-weight:500; font-size:15px; position:relative; min-height:46px;}
.nav a .ic{color:var(--forest); width:22px; height:22px;}
.nav a:hover{background:var(--mint-soft);}
.nav a[aria-current="page"]{background:var(--mint); color:var(--forest-deep); font-weight:600;}
.nav a[aria-current="page"]::before{content:""; position:absolute; left:-14px; top:9px; bottom:9px; width:4px; border-radius:0 4px 4px 0; background:var(--forest);}
.badge{margin-left:auto; background:var(--coral); color:#fff; font-size:12px; font-weight:700; border-radius:20px; padding:1px 8px; min-width:22px; text-align:center;}
.side-foot{margin-top:auto; padding-top:16px; border-top:1px solid var(--line);}
.me-row{display:flex; align-items:center; gap:10px; padding:4px 6px 8px;}
.me-txt b{display:block; font-size:14px; line-height:1.25;}
.me-txt small{color:var(--muted); font-size:12px;}
.me-actions{display:flex; flex-direction:column; gap:1px; padding:0 2px;}
.me-actions .link-btn{justify-content:flex-start; padding:7px 6px; width:100%; border-radius:8px; text-decoration:none; color:var(--ink); font-size:13.5px;}
.me-actions .link-btn:hover{background:var(--mint-soft);}
.me-actions .ic{width:18px; height:18px; color:var(--muted);}
.demo-note{font-size:11.5px; color:var(--muted); margin:10px 6px 0; line-height:1.4;}
.avatar{width:36px; height:36px; border-radius:50%; background:var(--forest); color:#fff; display:inline-flex; align-items:center; justify-content:center;
  font-family:var(--display); font-weight:700; font-size:15px; flex:none; letter-spacing:.02em;}
.avatar.sm{width:30px; height:30px; font-size:13px;}
.avatar.big{width:54px; height:54px; font-size:21px;}
.topbar{display:none;}
.scrim{position:fixed; inset:0; background:rgba(20,30,20,.35); z-index:55;}
.main{margin-left:var(--side); padding:30px 40px 60px; outline:none;
  padding-left:max(40px, calc((100vw - var(--side) - 1220px) / 2)); padding-right:max(40px, calc((100vw - var(--side) - 1220px) / 2));}
.main > *{max-width:1220px;}

/* ---------- page parts ---------- */
.page-head{display:flex; align-items:flex-end; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom:22px;}
.page-head h1{margin-bottom:4px;}
.lead{color:var(--muted); font-size:15.5px; max-width:720px; margin:0;}
.head-actions{display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap;}
.panel{background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); margin-bottom:18px;}
.panel > h2{margin-bottom:12px; display:flex; align-items:center; gap:9px;}
.panel > h2 .ic{color:var(--forest);}
.panel-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px;}
.two-col{display:grid; grid-template-columns:1fr 1fr; gap:18px;}
.two-col > .panel{margin-bottom:0;}
.two-col + .two-col{margin-top:18px;}
.back{display:inline-flex; align-items:center; gap:6px; text-decoration:none; font-weight:600; margin-bottom:14px; padding:6px 10px 6px 4px; border-radius:8px;}
.back:hover{background:var(--mint-soft);}
.fresh{font-size:12.5px; color:var(--muted); margin:10px 0 0; display:flex; gap:6px; align-items:flex-start;}
.fresh .ic{width:15px; height:15px; margin-top:2px;}

/* buttons */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:9px 18px; border-radius:11px;
  border:1.5px solid var(--line-2); background:var(--white); color:var(--ink); font-weight:600; font-size:15px; cursor:pointer;
  text-decoration:none; white-space:nowrap; transition:background .12s, border-color .12s, box-shadow .12s;}
.btn:hover{border-color:var(--forest); color:var(--forest-deep); background:var(--mint-soft);}
.btn .ic{width:19px; height:19px;}
.btn.primary{background:var(--forest); border-color:var(--forest); color:#fff;}
.btn.primary:hover{background:var(--forest-deep); border-color:var(--forest-deep); color:#fff;}
.btn.danger{background:var(--coral-deep); border-color:var(--coral-deep); color:#fff;}
.btn.danger:hover{background:#B5463E; color:#fff;}
.btn.ghost{background:transparent; border-color:transparent;}
.btn.ghost:hover{background:var(--mint-soft); border-color:transparent;}
.btn.small{min-height:36px; padding:6px 12px; font-size:14px; border-radius:9px;}
.btn.big{min-height:52px; font-size:16.5px; padding:12px 24px;}
.btn.wide{width:100%;}
.btn:disabled{opacity:.6; cursor:default;}
.icon-btn{display:inline-flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; border:none; background:transparent; color:var(--muted); cursor:pointer; flex:none;}
.icon-btn:hover{background:var(--mint-soft); color:var(--forest-deep);}
.icon-btn.small{width:32px; height:32px;}
.icon-btn.small .ic{width:17px; height:17px;}
.icon-btn[aria-pressed="true"]{background:var(--mint); color:var(--forest-deep);}
.link-btn{background:none; border:none; padding:0; color:var(--forest); font-weight:600; font-size:13.5px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; text-decoration:underline; text-underline-offset:2px;}

/* pills */
.pill{display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600; border-radius:20px; padding:2px 10px; line-height:1.6; white-space:nowrap; background:var(--gray-bg); color:var(--gray);}
.t-quote{background:var(--amber-bg); color:var(--amber);}
.t-consult{background:var(--coral-bg); color:var(--coral-deep);}
.t-po{background:var(--mint); color:var(--forest-deep);}
.t-card{background:var(--blue-bg); color:var(--blue);}
.s-new{background:var(--coral-bg); color:var(--coral-deep);}
.s-in_progress{background:var(--blue-bg); color:var(--blue);}
.s-quote_sent{background:var(--amber-bg); color:var(--amber);}
.s-po_received{background:var(--mint); color:var(--forest-deep);}
.s-won{background:#D3EBCB; color:#1E5A2C;}
.s-lost,.s-closed{background:var(--gray-bg); color:var(--gray);}
.a-in{background:var(--mint); color:var(--forest-deep);}
.a-out{background:#FFE6C7; color:#8A4300;}
.a-quote{background:var(--gray-bg); color:var(--gray);}
.a-later{background:var(--blue-bg); color:var(--blue);}
.new-pill{background:var(--coral); color:#fff;}

/* notices, empty, loading */
.notice{display:flex; gap:10px; align-items:flex-start; padding:12px 15px; border-radius:var(--radius-sm); background:var(--mint-soft); border:1px solid var(--mint-deep); color:var(--forest-deep); margin-bottom:14px; font-size:14.5px;}
.notice .ic{margin-top:1px;}
.notice.ok{background:var(--mint); border-color:var(--mint-deep);}
.notice.warn{background:var(--amber-bg); border-color:var(--amber-line); color:#6B4A0F;}
.notice.bad{background:var(--bad-bg); border-color:var(--bad-line); color:var(--bad);}
.notice a{font-weight:600;}
.empty{text-align:center; padding:40px 20px; color:var(--muted); background:var(--white); border:1px dashed var(--line-2); border-radius:var(--radius);}
.empty-ico{width:56px; height:56px; border-radius:50%; background:var(--mint); color:var(--forest); display:flex; align-items:center; justify-content:center; margin:0 auto 12px;}
.empty-ico .ic{width:28px; height:28px;}
.empty b{display:block; font-family:var(--display); font-size:20px; color:var(--ink); margin-bottom:4px;}
.empty p{max-width:460px; margin:0 auto 12px;}
.loading{display:flex; align-items:center; gap:12px; color:var(--muted); padding:30px 4px;}
.spin{width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(46,107,60,.2); border-top-color:var(--forest); animation:spin .8s linear infinite; flex:none; display:inline-block;}
.spin.sm{width:14px; height:14px; border-width:2px;}
@keyframes spin{to{transform:rotate(360deg)}}
.dim{opacity:.55; transition:opacity .15s;}

/* forms */
.form{display:flex; flex-direction:column; gap:14px;}
.field{display:flex; flex-direction:column; gap:5px; margin:0; border:none; padding:0; min-width:0;}
.field > span, .field legend, .fld-label{font-weight:600; font-size:14px; color:var(--ink);}
.field small{color:var(--muted); font-size:12.5px;}
.field.inline{gap:3px;}
.field.inline > span{font-size:12.5px; color:var(--muted); font-weight:600;}
input[type=text],input[type=password],input[type=search],input[type=number],input:not([type]),select,textarea{
  border:1.5px solid var(--line-2); border-radius:10px; padding:10px 12px; min-height:44px; background:var(--white); width:100%; font-size:15px;}
textarea{resize:vertical; line-height:1.5;}
select{cursor:pointer; padding-right:34px; appearance:none; -webkit-appearance:none;
  background:var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E6B3C' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center/18px;}
input:focus,select:focus,textarea:focus{border-color:var(--forest); outline:none; box-shadow:0 0 0 3px rgba(46,107,60,.15);}
input[readonly]{background:var(--gray-bg);}
.form-msg:empty{display:none;}
.form-msg .notice{margin:0;}
.radio-line{display:flex; align-items:center; gap:10px; padding:6px 0; cursor:pointer; font-weight:400;}
.radio-line input{width:18px; height:18px; accent-color:var(--forest);}
.row-form{flex-direction:row; align-items:flex-end; flex-wrap:wrap; gap:10px; margin-top:16px; padding-top:16px; border-top:1px solid var(--line);}

/* segmented buttons and tabs */
.seg{display:flex; flex-wrap:wrap; gap:6px; align-items:center;}
.seg-btn{border:1.5px solid var(--line-2); background:var(--white); border-radius:30px; padding:8px 16px; min-height:42px; cursor:pointer; font-weight:600; font-size:14px; color:var(--ink); display:inline-flex; align-items:center; gap:6px;}
.seg-btn:hover{border-color:var(--forest);}
.seg-btn[aria-pressed="true"]{background:var(--forest); border-color:var(--forest); color:#fff;}
.seg-btn .count{font-weight:500; font-size:12.5px; opacity:.8;}
.seg.small .seg-btn{min-height:34px; padding:4px 12px; font-size:13px;}
.tabs{display:flex; gap:4px; border-bottom:1.5px solid var(--line); margin-bottom:20px; overflow-x:auto; scrollbar-width:none;}
.tabs::-webkit-scrollbar{display:none;}
.tabs a{display:inline-flex; align-items:center; gap:7px; padding:11px 13px; text-decoration:none; color:var(--muted); font-weight:600; font-size:14.5px;
  border-bottom:3px solid transparent; margin-bottom:-1.5px; white-space:nowrap; border-radius:8px 8px 0 0;}
.tabs a:hover{color:var(--forest-deep); background:var(--mint-soft);}
.tabs a[aria-selected="true"]{color:var(--forest-deep); border-bottom-color:var(--forest);}
.tabs a .ic{width:18px; height:18px;}

/* ---------- home ---------- */
.cards4{display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; margin-bottom:18px;}
.stat-card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:18px 18px 16px; box-shadow:var(--shadow); display:flex; flex-direction:column;}
.stat-card h2{font-size:16px; display:flex; align-items:center; gap:8px; color:var(--forest-deep);}
.stat-card h2 .ic{color:var(--forest); width:19px; height:19px;}
.big-num{font-family:var(--display); font-weight:800; font-size:40px; line-height:1.1; color:var(--ink); margin-top:8px;}
.big-num.money{font-size:34px;}
.stat-base{font-size:12.5px; color:var(--muted); margin:2px 0 8px; line-height:1.4;}
.stat-card.small .big-num{font-size:32px;}
.card-link{margin-top:auto; padding-top:8px; font-weight:600; font-size:14px; text-decoration:none; display:inline-flex; align-items:center; gap:4px;}
.card-link .ic{width:16px; height:16px;}
.card-empty{font-size:13px; color:var(--muted);}
.mini-list{list-style:none; margin:0 0 6px; padding:0; border-top:1px solid var(--line);}
.mini-list a{display:flex; flex-direction:column; padding:7px 2px; border-bottom:1px solid var(--line); text-decoration:none; color:var(--ink);}
.mini-list a:hover .mini-who{color:var(--forest);}
.mini-who{font-weight:600; font-size:13.5px; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.mini-meta{font-size:12px; color:var(--muted);}
.today-list{margin:8px 0 4px; display:flex; flex-direction:column; gap:4px;}
.today-list div{display:flex; justify-content:space-between; align-items:baseline; border-bottom:1px solid var(--line); padding:5px 0;}
.today-list dt{color:var(--muted); font-size:14px;}
.today-list dd{margin:0; font-family:var(--display); font-weight:700; font-size:21px;}
.today-list small{font-family:var(--font); font-size:12px; color:var(--muted); font-weight:400;}
.star{color:#E0A100;}
.ask-box h2{display:flex; align-items:center; gap:9px; margin-bottom:6px;}
.ask-inline{display:flex; gap:10px; margin:12px 0 14px;}
.ask-inline input{min-height:52px; font-size:16px; border-radius:12px;}
.ask-inline .btn{min-height:52px; padding:0 26px;}
.examples{display:flex; flex-wrap:wrap; gap:8px; align-items:center;}
.examples.small{margin:-8px 0 18px;}
.ex-btn{border:1.5px solid var(--mint-deep); background:var(--mint-soft); color:var(--forest-deep); border-radius:22px; padding:8px 15px; font-size:14px; font-weight:500; cursor:pointer; text-align:left; line-height:1.35; min-height:40px;}
.ex-btn:hover{background:var(--mint); border-color:var(--forest);}
.strip{display:flex; flex-wrap:wrap; gap:8px; margin-top:4px;}
.strip-item{display:inline-flex; align-items:center; gap:8px; background:var(--white); border:1px solid var(--line); border-radius:30px; padding:7px 14px; font-size:13px; text-decoration:none; color:var(--ink);}
.strip-item span{color:var(--muted);}
.strip-item:hover{border-color:var(--forest);}
.dot{width:10px; height:10px; border-radius:50%; background:var(--gray); flex:none; display:inline-block;}
.dot.ok{background:var(--green); box-shadow:0 0 0 3px rgba(87,166,75,.2);}
.dot.warn{background:#E0A100; box-shadow:0 0 0 3px rgba(224,161,0,.2);}
.dot.off{background:#B5BDAF;}
.dot.bad{background:var(--coral-deep); box-shadow:0 0 0 3px rgba(201,85,76,.2);}
.dot.busy{background:var(--blue); animation:pulse 1.2s infinite;}
@keyframes pulse{50%{opacity:.35}}

/* record rows */
.rec-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
.rec-row{display:flex; align-items:center; gap:14px; background:var(--white); border:1px solid var(--line); border-radius:12px; padding:13px 16px; text-decoration:none; color:var(--ink); transition:border-color .12s, box-shadow .12s;}
.rec-row:hover{border-color:var(--forest); box-shadow:var(--shadow);}
.rec-dot{width:9px; height:9px; border-radius:50%; flex:none; background:transparent;}
.rec-row.unread .rec-dot{background:var(--coral);}
.rec-row.unread .rec-who{font-weight:700;}
.rec-main{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px;}
.rec-top{display:flex; align-items:center; gap:7px; flex-wrap:wrap;}
.rec-ref{font-size:12.5px; color:var(--muted); font-variant-numeric:tabular-nums; letter-spacing:.02em;}
.rec-who{font-size:16px; font-weight:600; font-family:var(--font); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.rec-sub{font-size:13px; color:var(--muted);}
.rec-right{display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex:none; text-align:right;}
.rec-total{font-family:var(--display); font-size:19px; font-weight:700;}
.list-count{font-size:13.5px; color:var(--muted); margin:0 0 10px;}

/* inbox filters */
.filters{background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; margin-bottom:16px; display:flex; flex-direction:column; gap:12px; box-shadow:var(--shadow);}
.filter-row{display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end;}
.filter-row .field.inline{min-width:180px;}
.filter-row .search-field{min-width:240px;}

/* record detail */
.detail-head{margin-bottom:16px;}
.detail-pills{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:8px;}
.detail-head h1{font-size:32px;}
.detail-sub{color:var(--muted); margin:4px 0 2px;}
.detail-sum{font-size:16px; margin:0;}
.detail-sum b{font-family:var(--display); font-size:24px;}
.action-bar{display:flex; flex-wrap:wrap; gap:12px 24px; align-items:flex-end; justify-content:space-between; background:var(--white); border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px; margin-bottom:16px; box-shadow:var(--shadow);}
.ab-group{display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end;}
.action-bar .field.inline{min-width:150px;}
.detail-top{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:start; margin-bottom:18px;}
.detail-top.single{grid-template-columns:1fr;}
.detail-top > .panel{margin:0;}
.detail-bottom{display:grid; grid-template-columns:minmax(0,1.35fr) minmax(0,1fr); gap:18px; align-items:start;}
.detail-bottom > .panel{margin:0;}
.stack{display:flex; flex-direction:column; gap:18px; min-width:0;}
.stack > .panel{margin:0;}
.cust-note{margin-top:14px; background:var(--paper); border-radius:10px; padding:10px 12px; font-size:14px;}
.cust-note b{display:block; font-size:12.5px; color:var(--muted); font-weight:500;}
.reasons{margin:0; padding-left:20px;}
.reasons li{margin:3px 0;}
.table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch; border-radius:10px;}
table{border-collapse:collapse; width:100%;}
.lines th,.mini-table th{text-align:left; font-size:12.5px; font-weight:600; color:var(--muted); padding:8px 10px; border-bottom:1.5px solid var(--line); white-space:nowrap; background:var(--paper);}
.lines td,.mini-table td{padding:10px; border-bottom:1px solid var(--line); vertical-align:top; font-size:14px;}
.lines td small,.mini-table td small{font-size:12px;}
.lines .r,.mini-table .r{text-align:right; white-space:nowrap;}
.lines tbody tr:hover{background:var(--mint-soft);}
.mini-table th[scope],.mini-table tr > th:first-child:not(:only-child){white-space:normal;}
.mini-table.wide td{white-space:nowrap;}
.totals{margin:14px 0 0 auto; max-width:380px; display:flex; flex-direction:column;}
.totals div{display:flex; justify-content:space-between; gap:20px; padding:5px 0; font-size:14.5px;}
.totals dt{color:var(--muted);}
.totals dd{margin:0; text-align:right;}
.totals .grand{border-top:1.5px solid var(--ink); margin-top:4px; padding-top:8px;}
.totals .grand dt{color:var(--ink); font-weight:700;}
.totals .grand dd{font-family:var(--display); font-weight:800; font-size:21px;}
.facts{margin:0; display:flex; flex-direction:column; gap:9px;}
.facts div{display:flex; flex-direction:column; gap:1px;}
.facts dt{font-size:12.5px; color:var(--muted); font-weight:500;}
.facts dd{margin:0; font-size:14.5px; overflow-wrap:anywhere;}
.facts.two{display:grid; grid-template-columns:1fr 1fr; gap:10px 18px;}
.facts.two .full{grid-column:1 / -1;}
.files{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
.files li{display:flex; flex-direction:column;}
.files a{display:inline-flex; gap:6px; align-items:center; font-weight:600;}
.notes{list-style:none; margin:0 0 12px; padding:0; display:flex; flex-direction:column; gap:10px;}
.notes li{background:var(--sun-bg); border:1px solid #F1E3A8; border-radius:10px; padding:10px 12px;}
.note-text{white-space:pre-wrap; font-size:14px;}
.note-form{gap:8px;}
.note-form .btn{align-self:flex-start;}
.timeline{list-style:none; margin:0; padding:0 0 0 14px; border-left:2px solid var(--mint-deep); display:flex; flex-direction:column; gap:10px;}
.timeline li{position:relative; font-size:14px;}
.timeline li::before{content:""; position:absolute; left:-20px; top:6px; width:10px; height:10px; border-radius:50%; background:var(--white); border:2px solid var(--forest);}
.conv summary{cursor:pointer; list-style:none; display:flex; align-items:center; gap:8px;}
.conv summary::-webkit-details-marker{display:none;}
.conv summary::before{content:""; width:9px; height:9px; border-right:2.5px solid var(--forest); border-bottom:2.5px solid var(--forest); transform:rotate(-45deg); transition:transform .15s; flex:none; margin-right:4px;}
.conv[open] summary::before{transform:rotate(45deg);}
.conv[open] summary{margin-bottom:12px;}
.transcript{display:flex; flex-direction:column; gap:10px; background:#F6FAF3; border-radius:12px; padding:14px; max-height:620px; overflow-y:auto;}
.t-msg{max-width:86%; display:flex; flex-direction:column; gap:3px;}
.t-msg.customer{align-self:flex-end; align-items:flex-end;}
.t-who{font-size:11.5px; color:var(--muted); font-weight:600; padding:0 4px;}
.t-text{padding:9px 13px; border-radius:14px; font-size:14px; background:var(--white); border:1px solid var(--line); overflow-wrap:anywhere;}
.t-msg.customer .t-text{background:var(--coral); color:#fff; border-color:var(--coral); border-bottom-right-radius:4px; white-space:pre-wrap;}
.t-msg.lucia .t-text{border-bottom-left-radius:4px;}
.t-event{align-self:center; font-size:12px; color:var(--muted); background:var(--white); border:1px dashed var(--line-2); border-radius:20px; padding:3px 12px;}
.t-books{font-size:12px; color:var(--muted); padding:2px 6px; display:flex; gap:6px;}
.t-books .ic{width:15px; height:15px;}
.intent-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:12px 0 16px;}
.choice-btn{border:1.5px solid var(--line-2); background:var(--white); border-radius:12px; padding:14px; font-weight:600; text-align:left; cursor:pointer; min-height:56px;}
.choice-btn:hover{border-color:var(--forest); background:var(--mint-soft);}
.choice-btn[aria-pressed="true"]{border-color:var(--forest); background:var(--mint);}
.draft{display:flex; flex-direction:column; gap:12px;}
.draft-actions{display:flex; gap:12px; align-items:center; flex-wrap:wrap;}

/* ---------- md (Lorenzo's and Lucía's answers) ---------- */
.md{overflow-wrap:anywhere;}
.md p{margin:0 0 9px;}
.md p:last-child{margin-bottom:0;}
.md ul,.md ol{margin:4px 0 10px; padding-left:22px;}
.md li{margin:3px 0;}
.md h3,.md h4{margin:12px 0 6px; font-size:16.5px;}
.md code{background:var(--gray-bg); border-radius:5px; padding:1px 5px; font-size:.92em;}
.md pre{background:var(--gray-bg); border-radius:8px; padding:10px 12px; overflow-x:auto; font-size:13px;}
.md blockquote{margin:6px 0; padding:4px 12px; border-left:3px solid var(--mint-deep); color:var(--muted);}
.md hr{border:none; border-top:1px solid var(--line); margin:12px 0;}
.md-table{overflow-x:auto; margin:8px 0 12px; border:1px solid var(--line); border-radius:10px;}
.md-table table{font-size:13.5px;}
.md-table th{background:var(--paper); text-align:left; font-weight:600; padding:7px 10px; border-bottom:1.5px solid var(--line); white-space:nowrap;}
.md-table td{padding:7px 10px; border-bottom:1px solid var(--line); vertical-align:top;}
.md-table td.nw{white-space:nowrap;}
.md-table tr:last-child td{border-bottom:none;}
.md-table .r{text-align:right;} .md-table .c{text-align:center;}

/* ---------- Ask Lorenzo ---------- */
.page-ask{padding-top:20px; padding-bottom:16px;}
.ask-layout{display:grid; grid-template-columns:240px minmax(0,1fr); gap:20px; height:calc(100vh - 36px); max-width:1220px;}
.chat-side{display:flex; flex-direction:column; gap:10px; min-height:0;}
.chat-side-top{display:flex; gap:8px;}
.chats-close{display:none;}
.side-h{font-size:14px; color:var(--muted); font-family:var(--font); font-weight:600; margin:8px 4px 0; text-transform:uppercase; letter-spacing:.06em;}
.chat-list{overflow-y:auto; flex:1; min-height:0;}
.chat-list ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:3px;}
.chat-list li{display:flex; align-items:center; border-radius:10px;}
.chat-list li:hover,.chat-list li.on{background:var(--white);}
.chat-list li.on{box-shadow:inset 3px 0 0 var(--forest);}
.chat-list a{flex:1; min-width:0; padding:9px 10px; text-decoration:none; color:var(--ink); display:flex; flex-direction:column;}
.chat-list a b{font-weight:500; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chat-list a small{color:var(--muted); font-size:12px;}
.chat-list .icon-btn{opacity:0;}
.chat-list li:hover .icon-btn,.chat-list li.on .icon-btn,.chat-list .icon-btn:focus-visible{opacity:1;}
.small-pad{padding:6px 8px; font-size:13.5px;}
.chat-main{display:flex; flex-direction:column; min-height:0; background:var(--white); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); overflow:hidden;}
.chat-head{display:flex; align-items:center; justify-content:space-between; padding:14px 20px; border-bottom:1px solid var(--line);}
.chat-head h1{font-size:24px;}
.chats-toggle{display:none;}
#ctx-box:empty{display:none;}
.ctx-chip{display:flex; align-items:center; gap:8px; margin:10px 20px 0; background:var(--amber-bg); border:1px solid var(--amber-line); border-radius:10px; padding:6px 6px 6px 12px; font-size:14px; color:#6B4A0F;}
.ctx-chip span{flex:1;}
.thread{flex:1; overflow-y:auto; padding:20px 22px; display:flex; flex-direction:column; gap:16px; background:#FAFCF8; min-height:0;}
.composer{display:flex; gap:10px; padding:14px 18px 8px; border-top:1px solid var(--line); align-items:flex-end; background:var(--white);}
.composer textarea{min-height:52px; max-height:180px; resize:none; font-size:15.5px; border-radius:12px; padding:13px 14px;}
.composer .btn{min-height:52px; padding:0 22px;}
.composer-hint{font-size:12px; color:var(--muted); padding:0 20px 12px; margin:0; background:var(--white);}
.ask-intro{max-width:720px; margin:10px auto; text-align:center;}
.ask-intro h2{font-size:26px; margin:12px 0 8px;}
.ask-intro > p{max-width:600px; margin:0 auto 18px;}
.ex-groups{display:grid; grid-template-columns:1fr 1fr; gap:14px; text-align:left;}
.ex-group{display:flex; flex-direction:column; gap:7px; align-items:flex-start;}
.ex-group h3{font-size:13px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-family:var(--font); font-weight:600;}
.cm{display:flex; gap:10px; align-items:flex-start;}
.cm.user{justify-content:flex-end;}
.cm-bubble{background:var(--forest); color:#fff; padding:10px 15px; border-radius:16px; border-bottom-right-radius:5px; max-width:78%; white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px;}
.cm-avatar{width:36px; height:36px; border-radius:50%; background:var(--coral); color:#fff; font-family:var(--display); font-weight:800; font-size:15px; display:flex; align-items:center; justify-content:center; flex:none;}
.cm-avatar.big{width:62px; height:62px; font-size:24px; margin:0 auto;}
.cm-card{background:var(--white); border:1px solid var(--line); border-radius:16px; border-top-left-radius:5px; padding:12px 16px; max-width:min(780px, 88%); min-width:min(320px, 80%); box-shadow:0 1px 2px rgba(0,0,0,.03);}
.cm-name{font-family:var(--display); font-weight:700; color:var(--forest); font-size:15px; margin-bottom:2px;}
.cm-steps{list-style:none; margin:2px 0 6px; padding:0; display:flex; flex-wrap:wrap; gap:6px;}
.cm-steps:empty{display:none;}
.cm-steps li{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); background:var(--paper); border:1px solid var(--line); border-radius:20px; padding:2px 10px 2px 7px;}
.cm-steps li .ic{width:14px; height:14px; color:var(--green); stroke-width:2.4;}
.cm-status{display:flex; align-items:center; gap:9px; color:var(--muted); font-size:14px; padding:4px 0;}
.cm-text:empty{display:none;}
.cm-foot{border-top:1px solid var(--line); margin-top:10px; padding-top:8px;}
.cm-sources{font-size:12.5px; color:var(--muted); display:flex; gap:6px; margin:0 0 4px;}
.cm-sources .ic{width:15px; height:15px; margin-top:2px;}
.cm-actions{display:flex; gap:2px;}
.cm-actions .icon-btn{width:36px; height:36px;}
.cm-actions .ic{width:18px; height:18px;}
.fb-form{display:flex; gap:8px; align-items:flex-end; margin-top:6px;}
.fb-form .field{flex:1;}
.proposal{border:1.5px solid var(--forest); background:var(--mint-soft); border-radius:12px; padding:12px 14px; margin-top:10px;}
.proposal-head{display:flex; align-items:center; gap:8px; color:var(--forest-deep); font-family:var(--display); font-size:16px; margin-bottom:4px;}
.proposal .mini-table{background:var(--white); border-radius:8px; margin:8px 0;}
.proposal-act{display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:13.5px;}

/* ---------- look up ---------- */
.big-search{display:flex; align-items:center; gap:10px; background:var(--white); border:1.5px solid var(--line-2); border-radius:16px; padding:6px 6px 6px 16px; box-shadow:var(--shadow); margin-bottom:18px; max-width:860px;}
.big-search:focus-within{border-color:var(--forest); box-shadow:0 0 0 3px rgba(46,107,60,.15);}
.big-search > .ic{color:var(--forest); width:24px; height:24px;}
.big-search input{border:none; box-shadow:none !important; min-height:52px; font-size:17px; padding:0 4px;}
.big-search .btn{min-height:50px; padding:0 26px;}
.book-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
.book-row{display:flex; gap:16px; align-items:center; background:var(--white); border:1px solid var(--line); border-radius:12px; padding:12px 16px; text-decoration:none; color:var(--ink);}
.book-row:hover{border-color:var(--forest); box-shadow:var(--shadow);}
.book-main{flex:1; min-width:0; display:flex; flex-direction:column; gap:1px;}
.book-main b{font-size:16px; line-height:1.3;}
.book-main .muted{font-size:13.5px;}
.book-meta{font-size:12.5px; color:var(--muted);}
.book-demand{font-size:12.5px; color:var(--forest); display:flex; align-items:center; gap:5px; margin-top:2px;}
.book-demand .ic{width:15px; height:15px;}
.book-right{display:flex; flex-direction:column; align-items:flex-end; gap:3px; text-align:right; flex:none;}
.book-right small{font-size:12px;}
.book-price{font-family:var(--display); font-size:19px;}
.cover{width:54px; height:72px; object-fit:cover; border-radius:5px; flex:none; background:var(--gray-bg); border:1px solid rgba(0,0,0,.06);}
.cover.sm{width:48px; height:66px;}
.cover.lg{width:150px; height:205px; border-radius:8px; box-shadow:var(--shadow);}
.cover.tile{display:flex; align-items:flex-end; padding:5px; color:#fff; font-family:var(--display); font-weight:700; font-size:9px; line-height:1.1; overflow:hidden; text-shadow:0 1px 3px rgba(0,0,0,.35);}
.cover.tile.lg{font-size:18px; padding:12px;}
.item-head{display:flex; gap:24px; align-items:flex-start; margin-bottom:20px;}
.item-txt{flex:1; min-width:0;}
.item-txt h1{font-size:30px;}
.item-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px;}
.item-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:18px;}
.item-grid .panel{margin-bottom:0;}
.all-cols,.desc{margin-top:12px;}
.all-cols summary,.desc summary,.unused summary,.qa-item summary{cursor:pointer; font-weight:600; color:var(--forest); font-size:14px;}
.all-cols .mini-table th{background:transparent; color:var(--muted); font-weight:500; width:44%;}
.desc p{font-size:14px; margin-top:8px;}

/* ---------- settings ---------- */
.jump{display:flex; flex-wrap:wrap; gap:6px; margin:-6px 0 16px;}
.jump a{font-size:13.5px; font-weight:600; text-decoration:none; padding:5px 12px; border-radius:20px; background:var(--white); border:1px solid var(--line);}
.jump a:hover{border-color:var(--forest);}
.settings-layout{display:grid; grid-template-columns:minmax(0,1fr) 400px; gap:22px; align-items:start;}
.set-group{scroll-margin-top:16px;}
.set-group > h2{margin-bottom:2px;}
.group-desc{margin-bottom:16px;}
.fld{padding:14px 0; border-top:1px solid var(--line); position:relative;}
.set-group > .fld:first-of-type,.group-desc + .fld{border-top:none; padding-top:4px;}
.fld.changed::before{content:""; position:absolute; left:-22px; top:14px; bottom:14px; width:4px; border-radius:0 4px 4px 0; background:var(--sun);}
.fld-label{display:block; margin-bottom:2px;}
.fld-help{font-size:13px; color:var(--muted); margin:0 0 8px;}
.fld-input{margin-top:6px;}
.fld-err{color:var(--bad); font-size:13px; font-weight:600;}
.fld-err:empty{display:none;}
.fld-marks{display:flex; gap:14px; flex-wrap:wrap; align-items:center; margin-top:6px;}
.fld-marks:empty{display:none;}
.chg{font-size:12px; font-weight:700; color:#7A5A00; background:var(--sun-bg); border-radius:20px; padding:1px 9px;}
.num-in{max-width:160px;}
.affix{display:inline-flex; align-items:center; border:1.5px solid var(--line-2); border-radius:10px; background:var(--white); overflow:hidden; max-width:220px;}
.affix:focus-within{border-color:var(--forest); box-shadow:0 0 0 3px rgba(46,107,60,.15);}
.affix span{padding:0 10px 0 14px; color:var(--muted); font-weight:600;}
.affix.after span{padding:0 14px 0 6px;}
.affix input{border:none; box-shadow:none !important; min-width:0;}
.switch{display:inline-flex; align-items:center; gap:10px; cursor:pointer; position:relative;}
.switch input{position:absolute; opacity:0; width:52px; height:30px; margin:0; cursor:pointer;}
.switch .track{width:52px; height:30px; border-radius:20px; background:#C8CEC2; position:relative; transition:background .15s; flex:none;}
.switch .track::after{content:""; position:absolute; left:3px; top:3px; width:24px; height:24px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .15s;}
.switch input:checked + .track{background:var(--forest);}
.switch input:checked + .track::after{transform:translateX(22px);}
.switch input:focus-visible + .track{outline:3px solid var(--sun); outline-offset:2px;}
.switch-txt{font-weight:600; font-size:14px;}
.radio-cards{display:grid; grid-template-columns:repeat(auto-fit, minmax(190px,1fr)); gap:10px;}
.radio-card{display:flex; gap:10px; align-items:flex-start; border:1.5px solid var(--line-2); border-radius:12px; padding:12px 14px; cursor:pointer; background:var(--white);}
.radio-card:hover{border-color:var(--forest);}
.radio-card:has(input:checked){border-color:var(--forest); background:var(--mint-soft); box-shadow:inset 0 0 0 1px var(--forest);}
.radio-card input{width:18px; height:18px; margin-top:3px; accent-color:var(--forest); flex:none;}
.radio-card b{display:block; font-size:14.5px;}
.radio-card small{display:block; color:var(--muted); font-size:12.5px; line-height:1.4; margin-top:2px;}
.list-edit{display:flex; flex-direction:column; gap:6px; align-items:flex-start;}
.list-row{display:flex; gap:4px; align-items:center; width:100%; max-width:440px;}
.pair{padding:14px 0; border-top:1px solid var(--line);}
.pair-h{font-weight:600; font-size:14px; margin-bottom:2px;}
.pair-cols{display:grid; grid-template-columns:1fr 1fr; gap:16px;}
.pair-cols .fld{border-top:none; padding:4px 0 0;}
.pair-cols .fld-label{display:none;}
.pair-cols .fld.changed::before{left:-10px;}
.lang-tag{display:inline-block; font-size:11.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--forest); background:var(--mint); border-radius:20px; padding:1px 9px;}
.unused{margin-top:10px; border-top:1px solid var(--line); padding-top:12px;}
.unused[open] summary{margin-bottom:6px;}
.preview{position:sticky; top:16px;}
.preview-card{background:var(--white); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:14px;}
.preview-tabs{display:flex; gap:4px; background:var(--paper); border-radius:10px; padding:4px; margin-bottom:12px;}
.preview-tabs button{flex:1; border:none; background:transparent; border-radius:8px; padding:8px 6px; font-weight:600; font-size:13px; cursor:pointer; color:var(--muted); min-height:38px;}
.preview-tabs button[aria-selected="true"]{background:var(--white); color:var(--forest-deep); box-shadow:0 1px 3px rgba(0,0,0,.1);}
.preview-body{min-height:300px;}
.preview-body .seg{margin-top:10px; justify-content:center;}
.preview-note{font-size:12px; color:var(--muted); margin:12px 2px 0;}
.lp-panel{border-radius:16px; overflow:hidden; border:1px solid var(--line); box-shadow:0 8px 24px rgba(25,40,20,.14);}
.lp-head{background:var(--forest); color:#fff; padding:11px 14px; display:flex; align-items:center; gap:10px;}
.lp-av{width:32px; height:32px; border-radius:50%; background:var(--coral); display:flex; align-items:center; justify-content:center; font-family:var(--display); font-weight:800; font-size:16px;}
.lp-head b{display:block; font-family:var(--display); font-size:15px; line-height:1.1;}
.lp-head small{font-size:11.5px; color:#CFE4CB;}
.lp-msgs{background:#F6FAF3; padding:14px 12px; display:flex; flex-direction:column; gap:9px; min-height:240px;}
.lp-msg{align-self:flex-start; max-width:92%; background:var(--white); border:1px solid var(--line); border-radius:14px; border-bottom-left-radius:4px; padding:9px 12px; font-size:13.5px; white-space:pre-wrap;}
.lp-langs{display:flex; gap:8px;}
.lp-lang{flex:1; text-align:center; border:1.5px solid var(--coral); color:var(--coral-deep); background:var(--white); border-radius:12px; padding:10px; font-weight:700; font-family:var(--display); font-size:16px;}
.lp-lang.picked{background:var(--coral); color:#fff;}
.lp-divider{font-size:11px; color:var(--muted); text-align:center; text-transform:uppercase; letter-spacing:.06em; display:flex; align-items:center; gap:8px;}
.lp-divider::before,.lp-divider::after{content:""; flex:1; border-top:1px dashed var(--line-2);}
.lp-options{display:flex; flex-direction:column; gap:6px;}
.lp-opt{background:var(--white); border:1.5px solid var(--forest); color:var(--forest-deep); border-radius:12px; padding:8px 12px; font-size:13.5px; font-weight:600;}
.lp-chips{display:flex; flex-wrap:wrap; gap:6px;}
.lp-chip{background:var(--white); border:1px solid var(--mint-deep); color:var(--forest); border-radius:20px; padding:4px 11px; font-size:12.5px;}
.pp-backdrop{background:rgba(35,58,42,.45); border-radius:14px; padding:22px 16px;}
.pp-modal{background:var(--white); border-radius:14px; padding:20px 18px; box-shadow:var(--shadow-lg); text-align:center;}
.pp-modal h3{font-size:21px; font-weight:800; margin-bottom:10px;}
.pp-modal p{font-size:13.5px; color:#3E5540;}
.pp-primary{display:block; background:var(--coral); color:#fff; border-radius:8px; padding:11px; font-weight:700; font-family:var(--display); font-size:16px; margin-top:12px;}
.pp-secondary{display:block; color:var(--coral-deep); text-decoration:underline; margin-top:9px; font-size:14px;}
.pp-small{font-size:12px !important; margin-top:8px;}
.cp-box{background:var(--paper); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:4px;}
.cp-line{background:var(--white); border:1px solid var(--line); border-radius:10px; padding:10px 12px; font-size:14px; display:flex; gap:8px; align-items:flex-start;}
.cp-line.ok{color:var(--forest-deep);}
.cp-foot{font-size:12.5px; color:var(--muted); padding:6px 4px 0;}
.cp-cap{font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 2px 10px;}
.savebar{position:fixed; left:calc(var(--side) + max(24px, (100vw - var(--side) - 1220px) / 2)); right:max(24px, calc((100vw - var(--side) - 1220px) / 2)); bottom:18px; z-index:70; display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  background:var(--ink); color:#fff; border-radius:16px; padding:12px 14px 12px 20px; box-shadow:var(--shadow-lg);}
.sb-count{font-weight:600;}
.savebar input{background:#fff; color:var(--ink); border-color:transparent; min-width:220px;}
.savebar .btn.ghost{color:#fff;}
.savebar .btn.ghost:hover{background:rgba(255,255,255,.12); color:#fff;}
.savebar .btn.primary{background:var(--sun); border-color:var(--sun); color:var(--ink);}
.savebar .btn.primary:hover{background:#E5B92B; border-color:#E5B92B; color:var(--ink);}
body.has-savebar .main{padding-bottom:120px;}
/* the Save button is always there: quiet until an edit ("No changes to save yet"), then "Save 3 changes" */
.savebar.idle{background:#3A5141; padding:9px 12px 9px 20px;}
.savebar.idle .sb-count{flex:1;}
.savebar .btn.primary:disabled{background:rgba(255,255,255,.16); border-color:transparent; color:#fff; opacity:1;}
.save-top{display:flex; align-items:center; justify-content:space-between; gap:12px 18px; flex-wrap:wrap; background:var(--sun-bg); border:1.5px solid var(--sun); border-radius:var(--radius); padding:12px 16px; margin-bottom:16px;}
.save-top.idle{background:var(--white); border:1px solid var(--line);}
.save-top-txt{margin:0; display:flex; flex-direction:column; gap:2px; flex:1 1 320px;}
.save-top-txt small{color:var(--muted); font-size:12.5px;}
.bq-dirty{align-self:flex-start;}
.note-full{white-space:pre-wrap; margin:0;}
/* Lucía settings > AI keys */
.ai-keys .panel-head{margin-bottom:4px;}
.ak-help-line{margin:0 0 6px; font-size:14px;}
.ak-row{display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px 18px; align-items:start; padding:14px 0; border-top:1px solid var(--line);}
.ak-main h3{font-size:16px; margin:0 0 3px;}
.ak-main h3 .muted{font-weight:500; font-size:14px;}
.ak-status{margin:0; font-size:14.5px;}
.ak-main .notice{margin:10px 0 0;}
.ak-actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.ak-form{grid-column:1 / -1; background:var(--paper); border:1px solid var(--line); border-radius:12px; padding:14px 16px; max-width:640px; gap:10px;}
.ak-form-btns{display:flex; gap:8px; flex-wrap:wrap;}
.ak-where{border-top:1px solid var(--line); padding-top:12px; font-size:14px;}
.ak-where summary{cursor:pointer; font-weight:600; color:var(--forest);}
.ak-where ol{margin:8px 0 0; padding-left:20px;}
.ak-where li{margin-bottom:4px;}
.hist{list-style:none; margin:0; padding:0;}
.hist-item.undone{opacity:.7;}
.hist-head{display:flex; gap:12px; align-items:center; margin-bottom:8px;}
.hist-reason{font-style:italic; color:var(--muted); margin:0 0 6px;}
.hist .mini-table{table-layout:fixed;}
.hist .mini-table th:first-child,.hist .mini-table td:first-child{width:26%;}
.hist .mini-table td{overflow-wrap:anywhere;}
.notes-intro{display:flex; gap:20px; align-items:flex-start;}
.notes-intro h2{margin-bottom:6px;}
.meter{height:12px; border-radius:10px; background:var(--gray-bg); overflow:hidden; margin:12px 0 6px; max-width:560px;}
.meter span{display:block; height:100%; background:linear-gradient(90deg, var(--green), var(--forest)); border-radius:10px;}
.meter-txt{font-size:13.5px; color:var(--muted); margin:0;}
.note-cards{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(320px,1fr)); gap:14px;}
.note-card{display:flex; flex-direction:column; margin:0;}
.note-top{display:flex; justify-content:space-between; gap:10px; align-items:flex-start;}
.note-top b{font-size:16px;}
.note-snip{font-size:13.5px; color:#44573F; margin:8px 0; white-space:pre-wrap; flex:1;}
.note-act{display:flex; gap:6px;}
.count-line{font-size:12.5px;}

/* ---------- activity ---------- */
.bars{display:flex; align-items:flex-end; gap:8px; height:190px; padding:10px 0 0;}
.bar-col{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; height:100%; gap:4px; min-width:0;}
.bar{width:100%; max-width:46px; background:linear-gradient(180deg, var(--leaf), var(--green)); border-radius:7px 7px 3px 3px; min-height:3px;}
.bar-val{font-size:12px; font-weight:600; color:var(--forest-deep);}
.bar-lbl{font-size:11.5px; color:var(--muted); white-space:nowrap;}
.conv-layout{display:grid; grid-template-columns:380px minmax(0,1fr); gap:18px; align-items:start;}
.conv-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; max-height:72vh; overflow-y:auto;}
.conv-item{width:100%; text-align:left; background:var(--white); border:1px solid var(--line); border-radius:12px; padding:11px 13px; cursor:pointer; display:flex; flex-direction:column; gap:3px;}
.conv-item:hover{border-color:var(--forest);}
.conv-item.on{border-color:var(--forest); background:var(--mint-soft); box-shadow:inset 3px 0 0 var(--forest);}
.conv-item b{font-weight:600; font-size:14px; line-height:1.35;}
.conv-tags{display:flex; gap:8px; align-items:center;}
.conv-view{position:sticky; top:16px; margin:0;}
.conv-meta{display:flex; flex-direction:column; margin-bottom:10px;}
.conv-view .transcript{max-height:64vh;}
.qa-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:0;}
.qa-item{margin-bottom:12px;}
.qa-q{font-size:15.5px; margin-bottom:6px;}
.qa-item details .md{margin-top:8px; font-size:14px; background:var(--paper); border-radius:10px; padding:10px 12px;}
.stars{color:#D8D2C4; letter-spacing:1px; font-size:16px; white-space:nowrap;}
.stars .on{color:#E0A100;}
.ratings-layout{display:grid; grid-template-columns:280px minmax(0,1fr); gap:18px; align-items:start;}
.rating-sum{text-align:center; position:sticky; top:16px;}
.rating-sum .big-num{font-size:52px;}
.rating-sum .stars{font-size:22px;}
.star-bars{list-style:none; padding:0; margin:12px 0 0; display:flex; flex-direction:column; gap:6px; font-size:13px;}
.star-bars li{display:grid; grid-template-columns:36px 1fr 28px; gap:8px; align-items:center;}
.sbar{height:9px; background:var(--gray-bg); border-radius:6px; overflow:hidden;}
.sbar span{display:block; height:100%; background:#E0A100; border-radius:6px;}
.rating-list{list-style:none; margin:0; padding:0;}
.rating-item{margin-bottom:12px;}
.rating-top{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:6px;}
.rating-comment{font-size:15px; margin:4px 0 6px;}

/* ---------- systems ---------- */
.sys-grid{display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:18px;}
.sys-card{margin:0; display:flex; flex-direction:column; gap:10px;}
.sys-card > p{margin:0;}
.sys-head{display:flex; gap:14px; align-items:center;}
.sys-ico{width:46px; height:46px; border-radius:12px; background:var(--mint); color:var(--forest); display:flex; align-items:center; justify-content:center; flex:none;}
.sys-ico .ic{width:24px; height:24px;}
.sys-state{display:flex; align-items:center; gap:8px; margin:2px 0 0; font-size:14px;}
.sys-sub{font-size:14px; font-family:var(--font); font-weight:600; color:var(--muted); margin-top:4px;}
.checks{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; font-size:14px;}
.checks .ic{color:var(--green); width:17px; height:17px; stroke-width:2.4; margin-right:4px;}
.sys-needs{display:flex; gap:8px; background:var(--paper); border-radius:10px; padding:10px 12px; font-size:13.5px; color:#44573F; margin:0;}
.sys-needs .ic{color:var(--muted); width:18px; height:18px; margin-top:1px;}
.sys-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:auto; padding-top:6px;}
.checks li{display:flex; align-items:flex-start; gap:2px;}
.checks li .ic{flex:none; margin-top:2px;}
.checks.adds .ic{color:var(--blue);}
.checks.gaps .ic{color:#B07A00;}
.checks.plain li{display:list-item; list-style:disc; margin-left:20px;}
.codes-note{display:flex; gap:8px; align-items:flex-start; background:var(--mint-soft); border:1px solid var(--mint-deep); border-radius:10px; padding:10px 12px; font-size:13.5px; color:var(--forest-deep); margin:2px 0 0;}
.codes-note .ic{flex:none; width:18px; height:18px; margin-top:1px; color:var(--forest);}
.saved-mask{display:inline-block; font-family:ui-monospace, Consolas, monospace; color:var(--ink); background:var(--gray-bg); border-radius:6px; padding:0 6px; margin-left:4px;}
.codes-clear{margin:0;}
.link-btn.danger-txt{color:var(--coral-deep);}
.link-btn.danger-txt:hover{color:var(--bad);}
.link-btn .ic{width:16px; height:16px;}
/* website checkout (Home card and Systems panel) */
.checkout-panel{margin-top:18px;}
.co-head{display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; margin:2px 0 8px;}
.co-head .big-num{margin:0;}
.co-head p{margin:0; font-size:15px; max-width:620px;}
.co-msg{margin:0 0 10px; max-width:820px;}
.funnel{list-style:none; margin:6px 0 12px; padding:0; display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; counter-reset:none;}
.funnel li{background:var(--mint-soft); border:1px solid var(--mint-deep); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:2px;}
.funnel li b{font-family:var(--display); font-size:26px; line-height:1.1; color:var(--ink);}
.funnel li span{font-size:13.5px; font-weight:600; color:var(--forest-deep);}
.funnel li small{font-size:12.5px; color:var(--muted);}
.co-refs{list-style:none; margin:4px 0 6px; padding:0; display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px;}
.co-refs li{border:1px solid var(--line); border-radius:12px; padding:10px 14px; display:flex; flex-direction:column; gap:3px; background:var(--paper);}
.co-refs li b{font-size:14.5px;}
.co-refs li small{font-size:12.5px; color:var(--muted); line-height:1.45;}
.co-card .loading{padding:12px 4px;}
.team-list{list-style:none; margin:0 0 6px; padding:0; display:flex; flex-direction:column;}
.team-list li{display:grid; grid-template-columns:auto minmax(0,1fr) 240px 150px auto; gap:10px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line);}
.team-list .grow small{display:block; margin-top:1px;}
.team-list li > select{min-height:36px; padding-top:6px; padding-bottom:6px; font-size:14px;}
@media (max-width:760px){
  .team-list li{display:flex; flex-wrap:wrap; gap:8px 10px;}
  .team-list .grow{flex:1 1 calc(100% - 52px);}
  .team-list li > select{flex:1 1 170px; width:auto;}
}

/* ---------- toasts and modals ---------- */
.toasts{position:fixed; right:20px; bottom:20px; z-index:300; display:flex; flex-direction:column; gap:10px; max-width:min(420px, calc(100vw - 32px));}
.toast{display:flex; gap:10px; align-items:flex-start; background:var(--ink); color:#fff; border-radius:14px; padding:12px 10px 12px 14px; box-shadow:var(--shadow-lg); animation:tin .22s ease-out;}
.toast.out{opacity:0; transform:translateY(8px); transition:all .22s;}
.toast.bad{background:var(--bad);}
.toast.new{background:var(--white); color:var(--ink); border:1.5px solid var(--coral); }
.toast-ico{color:var(--sun); margin-top:1px;}
.toast.new .toast-ico{color:var(--coral);}
.toast-body{flex:1; display:flex; flex-direction:column; font-size:14px; min-width:0;}
.toast-body b{font-family:var(--display); font-size:15.5px;}
.toast-body b:empty{display:none;}
.toast-act{background:var(--coral); color:#fff; border:none; border-radius:9px; padding:8px 14px; font-weight:700; cursor:pointer; align-self:center; min-height:38px;}
.toast-x{background:none; border:none; color:inherit; opacity:.7; cursor:pointer; padding:4px; border-radius:6px;}
.toast-x .ic{width:17px; height:17px;}
@keyframes tin{from{opacity:0; transform:translateY(10px)}}
body.has-savebar .toasts{bottom:96px;}
body:has(.main.page-ask) .toasts{bottom:118px;}
body.has-modal{overflow:hidden;}
.modal-wrap{position:fixed; inset:0; z-index:200; background:rgba(25,38,26,.48); display:flex; align-items:flex-start; justify-content:center; padding:6vh 16px 16px; overflow-y:auto;
  scroll-padding-bottom:96px;}   /* a field brought into view clears the sticky footer */
.modal{background:var(--white); border-radius:18px; width:min(520px, 100%); box-shadow:var(--shadow-lg); outline:none; animation:tin .18s ease-out;}
.modal.wide{width:min(760px, 100%);}
.modal-head{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:18px 18px 6px 24px;}
.modal-head h2{font-size:23px; font-weight:800;}
.modal-body{padding:8px 24px 16px;}
.modal-foot{display:flex; gap:10px; justify-content:flex-end; padding:14px 24px 20px; border-top:1px solid var(--line); flex-wrap:wrap;
  position:sticky; bottom:0; z-index:1; background:var(--white); border-radius:0 0 18px 18px;}

/* ---------- sign-in ---------- */
.signin{min-height:100vh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:30px 16px;
  background:radial-gradient(circle at 15% 10%, var(--mint) 0, transparent 40%), radial-gradient(circle at 90% 90%, var(--sun-bg) 0, transparent 40%), var(--paper);}
.signin-card{background:var(--white); border:1px solid var(--line); border-radius:22px; box-shadow:0 10px 40px rgba(35,58,42,.12); padding:30px 32px 32px; width:min(640px, 100%);}
.signin-brand{display:flex; align-items:center; gap:16px; margin-bottom:22px;}
.signin-brand img{border-radius:12px;}
.signin-brand h1{font-size:40px; color:var(--forest); line-height:1;}
.signin-brand p{margin:4px 0 0; color:var(--muted);}
.signin-q{font-size:22px; margin-bottom:14px;}
.name-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(170px,1fr)); gap:10px;}
.name-btn{display:flex; align-items:center; gap:11px; background:var(--white); border:1.5px solid var(--line-2); border-radius:14px; padding:11px 12px; cursor:pointer; font-weight:600; font-size:15px; text-align:left; min-height:60px;}
.name-btn:hover{border-color:var(--forest); background:var(--mint-soft);}
.name-btn.last{border-color:var(--forest);}
.signin-form{gap:16px;}
.who-picked{display:flex; gap:14px; align-items:center; margin-bottom:4px;}
.who-picked b{display:block; font-family:var(--display); font-size:24px;}
.who-picked .muted{display:block;}
.signin-form input{min-height:52px; font-size:17px;}
.signin-note{margin-top:16px; color:var(--muted); font-size:13.5px; display:flex; gap:8px; align-items:center; text-align:center;}
.signin-note .ic{width:17px; height:17px;}
.admin-signin{margin:18px 0 0; text-align:center;}
.admin-signin .link-btn{color:var(--muted); font-weight:500;}

/* ---------- responsive ---------- */
@media (max-width:1280px){
  .cards4{grid-template-columns:repeat(2, minmax(0,1fr));}
  .settings-layout{grid-template-columns:minmax(0,1fr) 340px;}
}
@media (max-width:1100px){
  .settings-layout{grid-template-columns:1fr;}
  .preview{position:static; order:-1;}
  .detail-top,.detail-bottom{grid-template-columns:1fr;}
  .conv-layout{grid-template-columns:300px minmax(0,1fr);}
  .sys-grid,.item-grid,.two-col{grid-template-columns:1fr;}
}
@media (max-width:900px){
  :root{--side:280px;}
  .topbar{display:flex; align-items:center; gap:8px; position:sticky; top:0; z-index:50; background:var(--white); border-bottom:1px solid var(--line); padding:8px 12px; height:58px;}
  .topbar .brand{padding:0;}
  .topbar .brand-name{font-size:23px;}
  .top-spacer{flex:1;}
  .side{transform:translateX(-102%); transition:transform .2s ease; box-shadow:var(--shadow-lg);}
  body.nav-open .side{transform:none;}
  .main{margin-left:0; padding:20px 16px 50px;}
  .savebar{left:12px; right:12px; bottom:10px;}
  .page-ask{padding:12px 12px 8px;}
  .ask-layout{grid-template-columns:1fr; height:calc(100dvh - 58px - 20px);}
  .chat-side{display:none;}
  .ask-layout.show-chats .chat-side{display:flex; position:fixed; inset:58px 0 0 0; z-index:45; background:var(--paper); padding:14px;}
  .chats-toggle{display:inline-flex;}
  .chats-close{display:inline-flex; flex:none;}
  .conv-layout,.ratings-layout{grid-template-columns:1fr;}
  .conv-view,.rating-sum{position:static;}
  .conv-list{max-height:none;}
}
@media (max-width:760px){
  h1{font-size:27px;}
  .detail-head h1{font-size:25px;}
  .cards4{grid-template-columns:1fr;}
  .big-num{font-size:34px;}
  .panel{padding:16px;}
  .rec-row{flex-wrap:wrap; gap:8px 12px; padding:12px 14px;}
  .rec-dot{display:none;}
  .rec-main{flex-basis:100%;}
  .rec-right{flex-direction:row; align-items:center; flex-wrap:wrap; gap:8px; width:100%; justify-content:flex-start;}
  .rec-right small{margin-left:auto;}
  .filter-row .field.inline{min-width:calc(50% - 6px); flex:1;}
  .filter-row .search-field{min-width:100%;}
  .seg{flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; scrollbar-width:none;}
  .seg-btn{flex:none;}
  .action-bar{gap:8px;}
  .ab-group{width:100%; gap:8px;}
  .action-bar .field.inline{min-width:calc(50% - 4px); flex:1;}
  .action-bar .btn{flex:1 1 calc(50% - 4px);}
  .action-bar .btn.primary{flex-basis:100%;}
  .ask-inline{flex-direction:column;}
  .ask-inline .btn{min-height:48px;}
  .ex-groups{grid-template-columns:1fr;}
  .thread{padding:14px 12px;}
  .cm-card{max-width:100%; min-width:0; flex:1;}
  .cm.bot .cm-avatar{display:none;}
  .cm-bubble{max-width:88%;}
  .composer{padding:10px 10px 6px;}
  .composer .btn{padding:0 14px;}
  .composer-hint{padding:0 12px 10px;}
  .chat-head{padding:10px 14px;}
  .chat-head h1{font-size:21px;}
  .book-row{flex-wrap:wrap;}
  .book-main{flex-basis:calc(100% - 70px);}
  .book-right{flex-direction:row; flex-wrap:wrap; align-items:center; width:100%; justify-content:flex-start; gap:8px;}
  .item-head{flex-direction:column; gap:14px;}
  .cover.lg{width:120px; height:164px;}
  .facts.two{grid-template-columns:1fr;}
  .funnel{grid-template-columns:1fr 1fr;}
  .co-refs{grid-template-columns:1fr;}
  .pair-cols{grid-template-columns:1fr;}
  .fld.changed::before{left:-16px;}
  .notes-intro{flex-direction:column;}
  .intent-grid{grid-template-columns:1fr;}
  .savebar{padding:10px 12px;}
  .savebar.idle{padding:8px 10px 8px 14px; flex-wrap:nowrap;}
  .savebar.idle .sb-count{font-size:13.5px;}
  .savebar .field{flex-basis:100%;}
  .savebar.idle .btn{flex:none;}
  .savebar input{min-width:0; flex-basis:100%;}
  .savebar .btn{flex:1;}
  .ak-row{grid-template-columns:1fr;}
  .ak-actions{justify-content:flex-start;}
  .save-top .btn{width:100%;}
  .modal-wrap{padding:12px 10px;}
  .modal-body,.modal-head,.modal-foot{padding-left:16px; padding-right:16px;}
  .signin-card{padding:22px 18px 24px;}
  .signin-brand h1{font-size:34px;}
  .name-grid{grid-template-columns:1fr 1fr;}
  .name-btn{min-height:54px; font-size:14px; padding:9px 10px; gap:8px;}
  .name-btn .avatar{width:32px; height:32px; font-size:13px;}
  .toasts{right:12px; left:12px; bottom:12px; max-width:none;}
  body.has-savebar .toasts{bottom:150px;}
  body:has(.main.page-ask) .toasts{bottom:128px;}
  .bars{gap:4px;}
  .bar-lbl{font-size:10px;}
  .big-search{padding-left:12px;}
  .big-search .btn{padding:0 16px;}
  .tabs a{padding:10px 9px; font-size:14px;}
  /* titles table becomes one card per title */
  .lines thead{display:none;}
  .lines, .lines tbody{display:block;}
  .lines tr{display:flex; flex-wrap:wrap; gap:4px 14px; padding:12px 0; border-bottom:1px solid var(--line);}
  .lines tbody tr:hover{background:transparent;}
  .lines td{display:block; border:none; padding:0; text-align:left !important; font-size:14px;}
  .lines td.c-title{flex-basis:100%; order:-2;}
  .lines td.c-isbn{flex-basis:100%; order:-1; font-size:12.5px;}
  .lines td.c-stock,.lines td.c-bc{flex:1 1 40%;}
  .lines td[data-label]::before{content:attr(data-label); display:block; font-size:11.5px; color:var(--muted); font-weight:600;}
  .lines td.c-isbn::before{display:inline; margin-right:6px;}
  .lines td.c-stock small.block,.lines td.c-bc small.block{display:inline; margin-right:6px;}
  .tabs a .ic{display:none;}
}
@media (prefers-reduced-motion:reduce){ *{animation:none !important; transition:none !important;} }
@media print{ .side,.topbar,.toasts,.action-bar,.composer{display:none !important;} .main{margin:0;} }

/* ---------- team activity (read only; js/pages/oversight.js) ---------- */
.ov-also{display:flex; gap:8px; align-items:flex-start; font-size:14px; color:var(--muted); margin:-8px 0 16px;}
.ov-also .ic{width:17px; height:17px; margin-top:2px; flex:none;}
.ov-filters{display:flex; gap:14px; align-items:flex-end; flex-wrap:wrap; margin-bottom:16px;}
.ov-filters select{min-width:200px;}
.ov-check{display:inline-flex; align-items:center; gap:8px; min-height:44px; font-size:14px; cursor:pointer;}
.ov-check input{width:18px; height:18px; min-height:0; flex:none; accent-color:var(--forest);}
.ov-count{align-self:center; margin-left:auto;}
.ov-readonly{display:flex; gap:7px; align-items:center; font-size:13px; color:var(--muted); background:var(--paper); border:1px dashed var(--line-2); border-radius:10px; padding:6px 10px; margin:0 0 10px;}
.ov-readonly .ic{width:15px; height:15px; flex:none;}
.ov-thread{display:flex; flex-direction:column; gap:14px; background:#FAFCF8; border-radius:12px; padding:14px; max-height:64vh; overflow-y:auto;}
.ov-thread .cm-card{max-width:92%;}
.ov-turn{display:flex; flex-direction:column; align-items:flex-end; gap:3px; max-width:82%;}
.ov-turn .cm-bubble{max-width:100%;}
.ov-who{font-family:var(--font); font-size:11.5px; color:var(--muted); font-weight:600;}
.ov-rated{font-size:12.5px; color:var(--muted); display:flex; gap:6px; margin:0;}
.ov-rated .ic{width:15px; height:15px; margin-top:2px; flex:none;}
.ov-trail{padding:6px 8px;}
.ov-when{white-space:nowrap; color:var(--muted);}
.ov-by{white-space:nowrap; font-weight:600;}
.ov-open{white-space:nowrap; font-size:13px; margin-left:6px;}
.ov-details{margin:4px 0 0; padding-left:18px; color:var(--muted); font-size:13px;}
.ov-details li{margin:2px 0; overflow-wrap:anywhere;}
.ov-people{margin-top:18px;}
@media (max-width:900px){ .ov-thread{max-height:none;} .ov-count{margin-left:0;} }
@media (max-width:760px){ .ov-filters .field{flex:1 1 100%;} .ov-filters select{min-width:0; width:100%;} .ov-when,.ov-by{white-space:normal;} }
