:root{
  --accent:#e0524e; --accent-ink:#fff; --page:#fff4f2; --panel:#ffe1dc; --panel-2:#ffcbc3;
  --accent-soft:rgba(224,82,78,.12);
  --text:#241f29; --text-dim:#615b69; --text-faint:#9a93a3;
  --border:rgba(40,30,50,.10); --border-strong:rgba(40,30,50,.17);
  --surface:#fff; --surface-2:#f8f7fb;
  --alert:#db4f4f; --alert-bg:rgba(219,79,79,.07); --alert-border:rgba(219,79,79,.22);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  background:var(--page);color:var(--text);
}
button,input,textarea{font-family:inherit}
.ic{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
::-webkit-scrollbar{width:11px;height:11px}
::-webkit-scrollbar-thumb{background:rgba(40,30,50,.16);border-radius:9px;border:3px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:rgba(40,30,50,.3);background-clip:content-box}
@keyframes up{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:none}}
@keyframes inn{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}

/* ---------- Layout ---------- */
.app{display:flex;height:100vh;width:100%;overflow:hidden;background:var(--page)}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.scroll{flex:1;overflow-y:auto;min-height:0}
.content{max-width:780px;margin:0 auto;padding:30px 38px 120px}

/* ---------- Sidebar ---------- */
.sidebar{
  width:278px;flex:none;background:var(--surface);border-right:1px solid var(--border);
  display:flex;flex-direction:column;height:100%;
}
.brand{display:flex;align-items:center;gap:11px;padding:22px 20px 16px;flex:none}
.brand-logo{width:40px;height:40px;border-radius:13px;background:var(--panel);display:flex;align-items:center;justify-content:center;color:var(--accent);flex:none}
.brand-logo svg{width:28px;height:28px}
.brand-t1{font-family:'Bricolage Grotesque',sans-serif;font-size:15px;font-weight:700;line-height:1.15;letter-spacing:-.01em}
.brand-t2{font-size:11.5px;font-weight:500;color:var(--text-faint)}
.nav-label{padding:4px 22px 10px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--text-faint)}
.nav{flex:1;overflow-y:auto;overflow-x:hidden;padding:0 13px 14px;display:flex;flex-direction:column;gap:3px;min-height:0}
.nav-item{display:flex;align-items:center;gap:12px;padding:9px 11px;border-radius:13px;cursor:pointer;font-size:14.5px;border:none;background:transparent;text-align:left;color:var(--text-dim);font-weight:500;width:100%}
.nav-item:hover{background:var(--surface-2)}
.nav-item.active{background:var(--panel);color:var(--accent);font-weight:700}
.nav-chip{flex:none;width:27px;height:27px;border-radius:9px;display:flex;align-items:center;justify-content:center;font-family:'Bricolage Grotesque',sans-serif;font-weight:700;font-size:12.5px;background:var(--panel);color:var(--accent)}
.nav-item.active .nav-chip{background:var(--accent);color:#fff}
.nav-txt{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.side-card{flex:none;margin:8px 15px 18px;padding:15px 16px;border-radius:16px;background:var(--panel)}
.side-card h4{font-family:'Bricolage Grotesque',sans-serif;font-weight:700;font-size:14.5px;margin:0 0 5px}
.side-card p{font-size:12.5px;line-height:1.5;color:var(--text-dim);margin:0}

/* ---------- Topbar ---------- */
.topbar{flex:none;height:64px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 22px 0 18px;border-bottom:1px solid var(--border)}
.crumb{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--text-faint);min-width:0}
.crumb-sep{opacity:.45}
.crumb-active{color:var(--text-dim);font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pill{display:flex;align-items:center;gap:8px;height:38px;padding:0 16px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);cursor:pointer;font-size:13px;font-weight:600;flex:none}
.pill:hover{color:var(--accent);border-color:var(--accent)}
.pill .ic{width:16px;height:16px}
.iconbtn{width:38px;height:38px;border-radius:11px;border:1px solid var(--border);background:var(--surface);color:var(--text-dim);cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none}
.iconbtn:hover{color:var(--text)}
.iconbtn .ic{width:18px;height:18px}
.menu-only{display:none}
.scrim{display:none}

/* ---------- Hero ---------- */
.hero{position:relative;overflow:hidden;background:var(--panel);border-radius:30px;padding:36px 40px 34px}
.hero-b1{position:absolute;top:-70px;right:-50px;width:230px;height:230px;border-radius:50%;background:var(--panel-2);opacity:.55}
.hero-b2{position:absolute;bottom:-90px;right:90px;width:150px;height:150px;border-radius:50%;background:var(--panel-2);opacity:.4}
.hero-in{position:relative}
.kicker{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;background:var(--accent);color:var(--accent-ink);font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;padding:6px 13px;border-radius:999px}
.hero h1{font-family:'Bricolage Grotesque',sans-serif;font-size:46px;line-height:1.03;letter-spacing:-.025em;font-weight:700;margin:16px 0 0;text-wrap:balance}
.hero .sub{font-size:13px;color:var(--text-dim);margin:13px 0 0;font-weight:500;letter-spacing:.01em}
.hero .lead{font-size:18px;line-height:1.55;color:var(--text);margin:16px 0 0;max-width:580px;text-wrap:pretty;opacity:.85}

/* ---------- Prose (vykreslené z .md) ---------- */
.prose{margin-top:14px}
.prose h2{font-family:'Bricolage Grotesque',sans-serif;font-size:26px;font-weight:700;letter-spacing:-.018em;margin:42px 0 12px}
.prose h3{font-family:'Bricolage Grotesque',sans-serif;font-size:19px;font-weight:700;margin:26px 0 8px}
.prose h4{font-family:'Bricolage Grotesque',sans-serif;font-size:16px;font-weight:700;margin:20px 0 6px}
.prose p{font-size:16.5px;line-height:1.72;color:var(--text-dim);margin:0 0 14px;text-wrap:pretty}
.prose strong{color:var(--text);font-weight:700}
.prose em{font-style:italic}
.prose code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86em;background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:1px 6px}
.prose ul,.prose ol{margin:0 0 16px;padding-left:0;list-style:none;display:flex;flex-direction:column;gap:10px}
.prose li{position:relative;font-size:16px;line-height:1.6;color:var(--text-dim);padding-left:30px;text-wrap:pretty}
.prose ul>li::before{content:"";position:absolute;left:6px;top:11px;width:7px;height:7px;border-radius:50%;background:var(--accent)}
.prose ol{counter-reset:n}
.prose ol>li{counter-increment:n;padding-left:42px;min-height:30px}
.prose ol>li::before{content:counter(n);position:absolute;left:0;top:0;width:30px;height:30px;border-radius:10px;background:var(--accent-soft);color:var(--accent);font-family:'Bricolage Grotesque',sans-serif;font-weight:700;font-size:15px;display:flex;align-items:center;justify-content:center}
.prose li strong{color:var(--text)}
.prose hr{border:none;border-top:1px solid var(--border);margin:30px 0}
/* kurzívový odstavec = tip (jako v původním designu) */
.prose .tip{display:flex;gap:13px;align-items:flex-start;background:var(--accent-soft);border-left:3px solid var(--accent);border-radius:4px 15px 15px 4px;padding:15px 18px;margin:6px 0 18px}
.prose .tip svg{flex:none;width:18px;height:18px;color:var(--accent);margin-top:1px}
.prose .tip p{margin:0;font-size:16px;line-height:1.6;color:var(--text);font-weight:500;font-style:italic}

.footer{margin-top:56px;padding-top:24px;border-top:1px solid var(--border);display:flex;align-items:center;gap:13px;font-size:13px;color:var(--text-faint)}
.footer .ava{flex:none;width:36px;height:36px;border-radius:50%;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12.5px;font-family:'Bricolage Grotesque',sans-serif}

/* ---------- Chat ---------- */
.chat-dock{position:fixed;right:30px;bottom:30px;z-index:60;display:flex;flex-direction:column;align-items:flex-end;gap:16px}
.chat-fab{display:flex;align-items:center;gap:11px;height:58px;padding:0 22px 0 10px;border-radius:999px;border:none;background:var(--accent);color:var(--accent-ink);cursor:pointer;font-size:14.5px;font-weight:700;box-shadow:0 16px 36px -12px rgba(40,30,50,.45);transition:transform .15s}
.chat-fab:hover{transform:translateY(-2px)}
.chat-fab-av{flex:none;width:42px;height:42px;border-radius:50%;background:var(--surface);display:flex;align-items:center;justify-content:center;color:var(--accent);animation:bob 3s ease-in-out infinite}
.chat-fab-av svg{width:30px;height:30px}
.chat-dock.open .chat-fab{width:54px;height:54px;padding:0;border-radius:50%;justify-content:center}
.chat-dock.open .chat-fab-av{width:auto;height:auto;background:none;animation:none}
.chat-dock.open .chat-fab-label{display:none}
.chat-dock.open .chat-fab-av svg{display:none}
.chat-dock.open .chat-fab::after{content:"";width:22px;height:22px;background:var(--accent-ink);-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 6l12 12M18 6L6 18' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/></svg>") center/contain no-repeat}

.chat-panel[hidden]{display:none}
.chat-panel{width:392px;max-width:88vw;height:580px;max-height:76vh;background:var(--surface);border:1px solid var(--border);border-radius:24px;box-shadow:0 30px 80px -20px rgba(40,30,50,.34);display:flex;flex-direction:column;overflow:hidden;animation:up .24s ease}
.chat-head{flex:none;display:flex;align-items:center;gap:13px;padding:15px 16px;border-bottom:1px solid var(--border);background:var(--panel)}
.chat-avatar{flex:none;width:42px;height:42px;border-radius:13px;background:var(--surface);display:flex;align-items:center;justify-content:center;color:var(--accent)}
.chat-avatar svg{width:30px;height:30px}
.chat-head-txt{flex:1;min-width:0}
.chat-name{font-family:'Bricolage Grotesque',sans-serif;font-size:17px;font-weight:700;line-height:1.2}
.chat-status{font-size:11.5px;color:var(--text-dim);display:flex;align-items:center;gap:5px}
.chat-status .dot{width:7px;height:7px;border-radius:50%;background:var(--accent);display:inline-block}
.chat-msgs{flex:1;overflow-y:auto;min-height:0;padding:18px;display:flex;flex-direction:column;gap:12px}

.msg-bot{align-self:flex-start;max-width:92%;display:flex;gap:9px;align-items:flex-end;animation:inn .25s ease}
.msg-bot-av{flex:none;width:28px;height:28px;border-radius:9px;background:var(--panel);display:flex;align-items:center;justify-content:center;color:var(--accent);margin-bottom:2px}
.msg-bot-av svg{width:20px;height:20px}
.msg-bot-body{min-width:0}
.bubble-bot{background:var(--surface-2);border:1px solid var(--border);color:var(--text);border-radius:16px 16px 16px 5px;padding:12px 14px;font-size:14.5px;line-height:1.55;text-wrap:pretty;white-space:pre-wrap;word-break:break-word}
.bubble-bot strong{font-weight:700}
.sources{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.src-chip{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--accent);background:var(--accent-soft);padding:5px 11px;border-radius:999px;border:none;cursor:pointer}
.src-chip svg{width:12px;height:12px}
.src-chip:hover{filter:brightness(.96);text-decoration:underline}

.msg-user{align-self:flex-end;max-width:84%;background:var(--accent);color:var(--accent-ink);border-radius:16px 16px 6px 16px;padding:11px 14px;font-size:14.5px;line-height:1.5;font-weight:500;animation:inn .25s ease;white-space:pre-wrap;word-break:break-word}

.suggest{display:flex;flex-direction:column;gap:9px;margin-top:2px}
.suggest-h{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--text-faint);margin:2px 2px 0}
.suggest-btn{text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:13px;padding:11px 14px;font-size:13.5px;color:var(--text);cursor:pointer;font-weight:500;display:flex;align-items:center;gap:10px}
.suggest-btn:hover{border-color:var(--accent);color:var(--accent)}
.suggest-btn svg{flex:none;width:14px;height:14px;color:var(--accent)}

.typing{display:flex;gap:4px;padding:4px 2px}
.typing i{width:7px;height:7px;border-radius:50%;background:var(--text-faint);display:inline-block;animation:bob 1s ease-in-out infinite}
.typing i:nth-child(2){animation-delay:.15s}
.typing i:nth-child(3){animation-delay:.3s}

.notice{align-self:center;max-width:96%;background:var(--alert-bg);border:1px solid var(--alert-border);color:var(--text);border-radius:14px;padding:10px 13px;font-size:12.5px;line-height:1.45}
.notice b{color:var(--alert)}

.chat-input{flex:none;border-top:1px solid var(--border);padding:14px;display:flex;gap:9px}
.chat-input input{flex:1;min-width:0;background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:12px 14px;font-size:14px;color:var(--text);outline:none}
.chat-input input:focus{border-color:var(--accent)}
.sendbtn{flex:none;width:44px;height:44px;border-radius:12px;border:none;background:var(--accent);color:var(--accent-ink);cursor:pointer;display:flex;align-items:center;justify-content:center}
.sendbtn:hover{filter:brightness(1.06)}
.sendbtn .ic{width:18px;height:18px}

/* ---------- Mobil ---------- */
@media(max-width:880px){
  .content{padding:24px 20px 130px}
  .hero{padding:28px 24px 26px}
  .hero h1{font-size:36px}
  .hero .lead{font-size:16px}
  .menu-only{display:flex}
  .sidebar{position:fixed;left:0;top:0;bottom:0;z-index:80;transform:translateX(-100%);transition:transform .22s ease;box-shadow:0 30px 80px -20px rgba(40,30,50,.4)}
  .app.nav-open .sidebar{transform:none}
  .app.nav-open .scrim{display:block;position:fixed;inset:0;background:rgba(20,15,25,.4);z-index:70}
  .chat-dock{right:16px;bottom:16px}
  .chat-panel{height:72vh}
}
