/* ===== Menu sheet ===== */
.sheetBack{
  position:fixed;inset:0;z-index:60;
  background:rgba(0,0,0,.30);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  display:grid;place-items:end center;
  padding:10px 0;
}
.sheetBack[hidden]{display:none !important}
.sheet{
  width:min(720px,92%);
  background:rgba(12,12,13,.84);
  border:1px solid rgba(245,245,245,.10);
  border-radius:18px 18px 0 0;
  padding:14px 14px 18px;
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
}
.sheetTop{display:flex;justify-content:space-between;align-items:center}
.sheetTitle{font-weight:950}
.sheetGroup{display:grid;gap:10px;margin-top:12px; max-height: calc(100svh - 150px); overflow:auto; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); -webkit-overflow-scrolling: touch;}
.item{
  display:block;
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(245,245,245,.12);
  background:rgba(245,245,245,.04);
  color:rgba(245,245,245,.92);
  text-decoration:none;
  text-align:left;
}
.item:hover{background:rgba(245,245,245,.055);border-color:rgba(245,245,245,.16)}
.item.primary{background:rgba(245,245,245,.06);border-color:rgba(245,245,245,.16);font-weight:900}
.item.danger{color:#ff4d57;border-color:rgba(255,77,87,.22)}
.item.danger:hover{background:rgba(255,77,87,.08);border-color:rgba(255,77,87,.26)}
.item.itemNav{display:flex;align-items:center;justify-content:space-between;gap:12px}
.itemLeft{display:flex;align-items:center;gap:10px;min-width:0}
.itemLeft span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.itemIcon{width:18px;height:18px;flex:0 0 18px;opacity:.92}
.itemRight{width:18px;height:18px;flex:0 0 18px;opacity:.95;display:flex;align-items:center;justify-content:center;font-size:20px;line-height:1}
.sheetFoot{margin-top:14px;display:flex;justify-content:center;gap:10px;flex-wrap:wrap;color:rgba(245,245,245,.72);font-size:13px}
.footlink{color:rgba(245,245,245,.80);text-decoration:none}
button.footlink{background:transparent;border:0;padding:0;font:inherit;cursor:pointer}
button.footlink:focus-visible{outline:2px solid rgba(255,255,255,.45);outline-offset:3px;border-radius:10px}

/* Ensure sheet items look the same for <a> and <button> */
button.item{
  appearance:none;
  -webkit-appearance:none;
  background: rgba(245,245,245,.04);
  border: 1px solid rgba(245,245,245,.12);
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.item.primary{background:rgba(245,245,245,.06);border-color:rgba(245,245,245,.16);font-weight:900}

/* ===== Result modal ===== */
.modalBack{
  position:fixed;inset:0;z-index:70;
  background:rgba(0,0,0,.28);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  display:grid;place-items:center;
}
.modalBack[hidden]{display:none !important}
.modalCard{
  width:min(640px,92%);
  background:rgba(12,12,13,.72);
  border:1px solid rgba(245,245,245,.10);
  border-radius:18px;
  padding:16px;
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  box-shadow:0 28px 90px rgba(0,0,0,.55);
  max-height:calc(100dvh - 64px - 20px);overflow:auto;overflow-x:hidden;word-break:break-word;overflow-wrap:anywhere;
}
.shareCard{
  background:rgba(0,0,0,.22);
  border:1px solid rgba(245,245,245,.12);
  border-radius:16px;
  padding:14px;
  text-align:center;
}
.shareTop{font-size:12px;color:rgba(245,245,245,.62)}
.shareName{font-size:20px;font-weight:950;margin-top:4px;letter-spacing:-.2px}
.shareQuote{font-size:13px;color:rgba(245,245,245,.72);margin-top:6px;line-height:1.35}
.shareBrand{font-size:11px;color:rgba(245,245,245,.45);margin-top:10px;text-transform:uppercase;letter-spacing:.18em}
.mini{margin-top:12px;margin-bottom:10px;border:1px solid rgba(245,245,245,.10);background:rgba(245,245,245,.04);border-radius:14px;padding:12px}
.miniTitle{font-size:12px;color:rgba(245,245,245,.70);margin-bottom:6px}
.miniList{margin:0;padding-left:18px;color:rgba(245,245,245,.82);font-size:13px;line-height:1.5}
.btn{
  border:1px solid rgba(245,245,245,.10);
  background:rgba(0,0,0,.12);
  color:rgba(245,245,245,.92);
  border-radius:14px;
  padding:12px 12px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;
}
.btn.gold{
  border-color:rgba(183,154,90,.26);
  background:rgba(183,154,90,.92);
  color:#111;font-weight:950;
}
.btn.ghost{
  background: rgba(245,245,245,.04);
  border-color: rgba(245,245,245,.12);
  color: rgba(245,245,245,.82);
}
.row{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.row .btn{flex:1 1 210px}

/* About modal */
.aboutTop{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.aboutTitle{font-size:14px;font-weight:950;letter-spacing:-.2px;opacity:.92}
.aboutBody{padding-top:2px}
.aboutRow{display:flex;align-items:center;gap:12px}
.aboutAvatar{width:64px;height:64px;border-radius:18px;object-fit:cover;object-position:50% 18%;border:1px solid rgba(245,245,245,.14);background:rgba(245,245,245,.04)}
.aboutName{font-weight:950;letter-spacing:-.2px}
.aboutSub{margin-top:3px;font-size:12px;color:rgba(245,245,245,.62)}
.aboutText{margin:12px 0 0;font-size:13px;color:rgba(245,245,245,.74);line-height:1.45}


/* Intro card inside chat */
.bubble.intro{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
}
.introTop{ font-weight:900; margin-bottom:6px; }
.introMini{ color: rgba(245,245,245,.78); font-size:13px; line-height:1.45; }
.introToggle{
  margin-top:10px;
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.10);
  color:rgba(245,245,245,.90);
  cursor:pointer;
  font-weight:850;
  font-size:12px;
}
.introMore{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.10);
  color: rgba(245,245,245,.74);
  font-size:13px;
  line-height:1.5;
}
.introMore[hidden]{ display:none !important; }

/* Notes modal */
.notesBody{ padding-top:6px; }
.notesHint{ font-size:12px; color:rgba(245,245,245,.62); line-height:1.4; }
.notesTools{ display:flex; gap:10px; align-items:center; margin-top:10px; }
.notesSearch{
  flex:1;
  height:40px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(245,245,245,.92);
  padding:0 12px;
  outline:none;
  font-size:14px;
}
.notesFilter{
  width:40px;height:40px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.10);
  color:rgba(245,245,245,.92);
  cursor:pointer;
  display:grid;place-items:center;
}
.notesFilter[aria-pressed="true"]{ background:rgba(183,154,90,.16); border-color:rgba(183,154,90,.30); }
.notesInput{
  width:100%;
  margin-top:10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.04);
  color:rgba(245,245,245,.92);
  padding:12px;
  outline:none;
  resize:vertical;
}
.notesActions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:10px; }
.notesActions .btn{ flex:1 1 160px; }
.notesList{ margin-top:12px; display:grid; gap:10px; }
.noteCard{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  padding:12px;
}
.noteMeta{ font-size:12px; color:rgba(245,245,245,.58); display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.noteText{ margin-top:8px; color:rgba(245,245,245,.90); font-size:14px; line-height:1.55; white-space:pre-wrap; }
.noteBtns{ margin-top:10px; display:flex; gap:10px; }
.noteBtn{
  flex:1;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.10);
  color:rgba(245,245,245,.92);
  cursor:pointer;
  font-weight:850;
  font-size:12px;
}
.noteBtn.danger{ border-color:rgba(255,255,255,.10); background:rgba(255,255,255,.04); color:rgba(245,245,245,.80); }

@media (max-width:420px){
  .right{gap:8px}
  .icon{width:34px;height:34px}
}

input,textarea,select{font-size:16px}

#resPrimary{margin-top:12px}

.micro{margin:12px 0 0;font-size:14px;color:rgba(245,245,245,.72);text-shadow:0 10px 30px rgba(0,0,0,.55)}
.micro2{margin:6px 0 0;font-size:13px;color:rgba(245,245,245,.60)}

.testNav{
  display:flex;
  gap:10px;
  padding:12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(245,245,245,.10);
  background:rgba(0,0,0,.18);
}
.navBtn{
  flex:1;
  height:46px;
  border-radius:14px;
  border:1px solid rgba(245,245,245,.14);
  background:rgba(245,245,245,.05);
  color:rgba(245,245,245,.92);
  font-weight:800;
  cursor:pointer;
}
.navBtn:disabled{opacity:.45;cursor:not-allowed}
.navBtn.gold{
  border-color:rgba(183,154,90,.26);
  background:rgba(183,154,90,.92);
  color:#111;
}

.btnWide{width:100%}

.ctaHint{margin:12px 0 10px;font-size:13px;color:rgba(245,245,245,.72);line-height:1.35}

#resPrimary{margin-top:10px}

@media (max-height:720px){.center{transform:translateY(-6svh)}}

.analyze{
  position:sticky;
  top:0;
  margin:10px 14px 0;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(245,245,245,.14);
  background:rgba(245,245,245,.05);
  color:rgba(245,245,245,.82);
  font-weight:800;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:center;
}
.analyze::after{
  content:"";
  width:14px;height:14px;
  border-radius:999px;
  border:2px solid rgba(245,245,245,.35);
  border-top-color:rgba(183,154,90,.95);
  animation:spin .5s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

.analyze[hidden]{display:none !important}

/* Analyze micro-animation: 0.9s (0.2 in, 0.5 hold, 0.2 out) */
.analyze{opacity:0; transform:translateY(4px);}
.analyze.run{
  animation:anRun .9s ease-in-out both;
}
@keyframes anRun{
  0%{opacity:0; transform:translateY(6px);}
  22%{opacity:1; transform:translateY(0px);}   /* ~0.2s */
  78%{opacity:1; transform:translateY(0px);}   /* ~0.7s */
  100%{opacity:0; transform:translateY(-2px);} /* ~0.9s */
}
@media (prefers-reduced-motion: reduce){
  .analyze.run{animation:none;opacity:1;transform:none}
}

.social{display:flex;gap:10px;align-items:center}
.soc{
  width:38px;height:38px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  color:rgba(245,245,245,.92);
  text-decoration:none;
}
.soc span{font-weight:800;font-size:13px;opacity:.9}

.chatHelpBtn{
  margin-left:auto;
  width:42px;height:42px;border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow: 0 10px 26px rgba(0,0,0,.35);
  color:rgba(245,245,245,.92);
  font-weight:950;
  cursor:pointer;
  display:grid;place-items:center;
}



/* Mini dock (chat) – iOS-like quick actions */
.miniDock{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 10px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.dockBtn{
  flex:1 1 0;
  min-width:0;
  height:40px;
  padding:0 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.94);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  cursor:pointer;
  line-height:1;
}
.dockBtn svg{ width:18px;height:18px; display:block; opacity:.92; flex:0 0 auto;}
.dockLbl{
  font-size:12px;
  font-weight:800;
  letter-spacing:.02em;
  opacity:.92;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.dockBtn:active{ transform:scale(.99); opacity:.88; }
.dockBtn--more{ background:rgba(255,255,255,.05); }

@media (max-width:420px){
  .miniDock{ padding:8px 8px; gap:8px; }
  .dockBtn{ height:38px; padding:0 10px; }
  .dockLbl{ font-size:11px; }
}

/* iOS-like sheet (Więcej) */
.sheetBack{
  position:fixed;inset:0;z-index:12010;
  background:rgba(0,0,0,.30);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  display:grid;place-items:end center;
  padding:10px 0;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.sheetBack[hidden]{display:none !important}
.sheetBack.isOpen{opacity:1;pointer-events:auto;}
.sheet{
  width:min(520px,92%);
  background:rgba(12,12,13,.84);
  border:1px solid rgba(245,245,245,.10);
  border-radius:18px 18px 0 0;
  padding:14px 14px 18px;
  backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);
  box-shadow:0 30px 90px rgba(0,0,0,.60);
  transform:translateY(18px);
  transition:transform .22s ease;
  max-height: calc(100svh - 24px);
  overflow: hidden;
}
.sheetBack.isOpen .sheet{transform:translateY(0);}
.sheetGrab{width:44px;height:5px;border-radius:999px;margin:2px auto 10px;background:rgba(245,245,245,.22)}
.sheetTop{display:flex;justify-content:space-between;align-items:center}
.sheetTitle{font-weight:950;opacity:.92}
.sheetGroup{display:grid;gap:10px;margin-top:12px; max-height: calc(100svh - 150px); overflow:auto; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); -webkit-overflow-scrolling: touch;}
.item{
  display:block;
  width:100%;
  padding:14px;
  border-radius:14px;
  border:1px solid rgba(245,245,245,.12);
  background:rgba(245,245,245,.04);
  color:rgba(245,245,245,.92);
  text-decoration:none;
  text-align:left;
  font-weight:800;
  font-family: inherit;
  font-size:14px;
  line-height:1.2;
  appearance:none;
}
.item.primary{background:rgba(245,245,245,.06);border-color:rgba(245,245,245,.16);font-weight:950}
.item:active{opacity:.82}

/* Toolbox (only used inside chat modal) */
#toolboxSheet{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.22);
  display:flex;
  align-items:flex-end;
  justify-content:flex-start;
  padding:16px;
  z-index:9999;
}
#toolboxSheet[hidden]{display:none !important}
.toolboxCard{
  width:min(320px, 86vw);
  border-radius:18px;
  padding:14px 16px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(18,18,20,.78);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}
.toolboxTitle{
  font-size:12px;
  letter-spacing:.2px;
  opacity:.72;
  margin-bottom:10px;
  font-weight:800;
}
.toolboxCard .tool{
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  color:rgba(245,245,245,.94);
  padding:12px 0;
  font-size:15px;
  border-top:1px solid rgba(255,255,255,.08);
}
.toolboxCard .tool:first-of-type{border-top:0}
.toolboxCard .tool:active{opacity:.6}

a{color:inherit}

