:root{
  --bg:#1a2118;
  --paper:#f0dcc0;
  --paper-2:#dcbf93;
  --ink:#2b2118;
  --muted:#6f5c45;
  --line:rgba(48,35,23,.24);
  --panel:rgba(255,242,215,.86);
  --button:#2f5f4a;
  --button-ink:#fff4db;
  --danger:#8a3b2e;
}
html,body{height:100%;margin:0}
body{
  background:
    linear-gradient(135deg, rgba(27,78,72,.62), rgba(164,86,45,.34)),
    var(--bg);
  color:var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  overflow:auto;
}
*{
  scrollbar-width:thin;
  scrollbar-color:rgba(121,84,46,.86) rgba(255,246,224,.48);
}
::-webkit-scrollbar{
  width:12px;
  height:12px;
}
::-webkit-scrollbar-track{
  background:rgba(255,246,224,.48);
  border-radius:999px;
}
::-webkit-scrollbar-thumb{
  background:linear-gradient(180deg, #bd9153, #79542e);
  border:3px solid rgba(255,246,224,.74);
  border-radius:999px;
}
::-webkit-scrollbar-thumb:hover{
  background:linear-gradient(180deg, #c99d5d, #674226);
}
::-webkit-scrollbar-corner{
  background:transparent;
}
.wrap{
  min-height:100%;
  display:grid;
  place-items:center;
  padding:18px;
  box-sizing:border-box;
}
.app{
  width:min(1080px, 96vw);
}
.hero{
  border:1px solid rgba(255,244,220,.36);
  background:
    linear-gradient(180deg, rgba(255,246,225,.92), rgba(222,190,140,.88)),
    var(--paper);
  border-radius:8px;
  padding:18px;
  box-shadow: 0 24px 70px rgba(10,16,12,.42);
}
.top{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  flex-wrap:wrap;
  text-align:center;
  border-bottom:2px solid rgba(77,54,33,.2);
  padding-bottom:14px;
}
h1{
  margin:0;
  color:#26321f;
  font-size:clamp(32px, 6vw, 58px);
  line-height:.9;
  letter-spacing:0;
}
.sub{
  margin-top:8px;
  color:var(--muted);
  font-size:14px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight:700;
}
.grid{
  display:grid;
  grid-template-columns: minmax(260px, .72fr) 1.28fr;
  gap:14px;
  margin-top:14px;
}
.card{
  border:1px solid var(--line);
  background: var(--panel);
  border-radius:8px;
  padding:14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
}
.card h3{
  margin:0 0 12px 0;
  font-size:13px;
  letter-spacing:0;
  color:#493721;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  text-transform:uppercase;
}
.field{display:grid; gap:8px; margin-bottom:12px}
label{
  font-size:12px;
  color:var(--muted);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight:800;
}
input{
  width:100%;
  box-sizing:border-box;
  padding:12px 12px;
  border-radius:6px;
  border:1px solid rgba(65,47,31,.32);
  background:#fff3d8;
  color:#2b2118;
  outline:none;
  font-weight:800;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
input:focus{
  border-color:#2f5f4a;
  box-shadow:0 0 0 3px rgba(47,95,74,.16);
}
.bots{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
.bot{
  border:1px solid rgba(55,39,24,.28);
  background:linear-gradient(180deg, #f8e8c9, #d9b982);
  border-radius:8px;
  padding:8px;
  cursor:pointer;
  user-select:none;
  min-height:154px;
  display:grid;
  grid-template-rows: 1fr auto;
  gap:8px;
  position:relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.58);
}
.bot:hover{
  transform:translateY(-1px);
  border-color:rgba(47,95,74,.54);
}
.bot.on{
  background:linear-gradient(180deg, #fff0c7, #cfa363);
  outline:3px solid rgba(47,95,74,.72);
}
.bot.on::after{
  content:"";
  position:absolute;
  right:8px;
  top:8px;
  width:13px;
  height:13px;
  border-radius:50%;
  background:#2f5f4a;
  box-shadow:0 0 0 3px rgba(255,244,219,.82);
}
.botPreview{
  width:100%;
  aspect-ratio:128 / 110;
  display:block;
  border-radius:6px;
  background:
    linear-gradient(180deg, rgba(82,122,94,.22), rgba(120,82,45,.18)),
    #ecd3a8;
}
.botMeta{
  display:grid;
  gap:2px;
  min-width:0;
}
.bot b{
  color:#312215;
  font-size:12px;
  line-height:1.1;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bot span{
  color:#765a35;
  font-size:11px;
  line-height:1.1;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight:800;
}
.row{display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:flex-start}
.btn{
  width:100%;
  padding:12px 14px;
  border-radius:6px;
  border:1px solid rgba(15,34,27,.32);
  background:linear-gradient(180deg, #3c7359, var(--button));
  color:var(--button-ink);
  font-weight:900;
  cursor:pointer;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.btn:active{transform: translateY(1px)}
.err{
  color:var(--danger);
  font-size:12px;
  white-space:pre-wrap;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight:800;
}
.hint{
  color:var(--muted);
  font-size:12px;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight:700;
}
.footerMeta{
  margin-top:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  text-align:center;
}
.footerBtn{
  width:auto;
  min-width:88px;
  padding:9px 14px;
}
.btn-link{
  font-size:12px;
  color:#315c48;
  font-weight:900;
  text-decoration:underline;
  text-underline-offset:2px;
  border:none;
  background:none;
  padding:0;
  cursor:pointer;
  user-select:none;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.btn-link:hover{color:#1e3f31}
.ca{
  color:var(--muted);
  font-size:12px;
  word-break:break-all;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.modalBackdrop{
  position:fixed;
  inset:0;
  background:rgba(24,18,12,.46);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:20;
  padding:16px;
  box-sizing:border-box;
}
.modalBackdrop.open{display:flex}
.modalCard{
  width:min(540px, 92vw);
  max-height:min(86vh, 680px);
  overflow:auto;
  border-radius:8px;
  border:1px solid rgba(65,47,31,.28);
  background:rgba(255,240,207,.97);
  box-shadow:0 30px 100px rgba(0,0,0,.38);
  padding:18px;
  text-align:center;
}
.modalTitle{
  font-weight:900;
  margin:0 0 10px 0;
  color:#2b2118;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.modalText{
  font-size:14px;
  line-height:1.5;
  color:#4b3a29;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
}
.modalText section{margin:0 0 12px}
.modalText section:last-child{margin-bottom:0}
.modalText h4{margin:10px 0 7px; color:#2b2118; font-size:14px; font-weight:900}
.modalText ul{
  margin:0;
  padding-left:20px;
  text-align:left;
}
.modalText li{margin:6px 0}
.modalActions{display:flex; justify-content:center; margin-top:14px}
.modalCloseBtn{
  width:auto;
  min-width:96px;
}
@media (max-width:900px){
  .grid{grid-template-columns:1fr}
  .bots{grid-template-columns: repeat(3, minmax(0, 1fr))}
}
@media (max-width:560px){
  .wrap{padding:10px}
  .hero{padding:12px}
  .bots{grid-template-columns: repeat(2, minmax(0, 1fr))}
  .bot{min-height:142px}
}
