/* =========================================================
   FS3 COMPONENTS (desktop-first)
   Qcard + list + add-row + header menu + dnd marker + states
   (no toast, no modals, no share modal, no mobile)
   ========================================================= */

/* =========================================================
   Header: "more" button + dropdown menu
   ========================================================= */

/* Кнопка 3 точки в заголовке (по умолчанию скрыта — только мобилка) */
.fs3-header-more{
  display:none;
}

/* Выпадающее меню заголовка */
.fs3-header-menu{
  position:absolute;
  right:0;
  top:100%;
  margin-top:6px;
  background:#FFFFFF;
  border-radius:12px;
  box-shadow:0 10px 25px rgba(15,23,42,.25);
  padding:4px;

  /* ✅ hug content */
  min-width:max-content; /* ✅ was 0 */
  width:max-content;
  max-width:calc(100vw - 24px);

  display:none;
  z-index:10000;
}
.fs3-header-menu.show{
  display:flex;            /* ✅ was block */
  flex-direction:column;   /* ✅ enforce vertical menu */
}
.fs3-header-menu button{
  width:auto; /* ✅ was 100% */
  display:block; /* ✅ ensure each item takes its own row */
  border:none;
  background:transparent;
  text-align:left;
  padding:8px 12px;
  font-family:"Noah", sans-serif;
  font-size:16px;
  color:#0C0F1C;
  border-radius:8px;
  cursor:pointer;

  /* ✅ prevent wrapping so menu can hug */
  white-space:nowrap;
}
.fs3-header-menu button:hover{
  background:#F3F4F6;
}

/* ✅ mobile: make menu items a bit bigger */
@media (max-width:768px){
  .fs3-header-menu button{
    font-size:16px; /* ✅ was 14px */
  }
}

/* Header layout (make it the same as on tablet/mobile) */
.fs3-header{
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 0;
}
.fs3-header > h3{
  margin-bottom: 24px;
}
.fs3-header-right{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;

  /* ✅ Needed for the absolute-positioned .fs3-header-menu */
  position: relative;
}

/* Header actions order (make it the same as on mobile) */
#fs3-copy-btn{ order:1; margin-right:12px; }
#fs3-save-btn{ order:2; margin-right:12px; }
#fs3-share-btn{ order:3; margin-right:12px; }
#fs3-new-list-btn{ order:4; margin-right:12px; }
#fs3-reset-btn{ order:5; margin-right:0; }
#fs3-compare{
  order:6;
  margin-left:24px;
  margin-right:0;
}

/* =========================================================
   Compare card (questions)
   ========================================================= */

.fs3-qcard{ display:none; }

#fs3-stats{ margin-top:28px; }

.fs3-progress{
  height:8px;
  border-radius:999px;
  background:#CECFD9;
  overflow:hidden;
  margin:12px 0 28px;
}
.fs3-progress > span{
  display:block;
  height:100%;
  width:0;
  background:#3F52B3;
}

.fs3-qcol{
  display:grid;
  grid-template-columns: minmax(0,1fr) 124px;
  grid-template-rows: auto auto;
  column-gap:12px;
  row-gap:12px;
  margin-top:10px;
  align-items:stretch;
}

/* ====== Reduced qbox height ====== */
.fs3-qbox{
  border:1px solid #CECFD9;
  border-radius:18px;
  padding:16px 18px;
  min-height:unset;
  background:#FFFFFF;
  cursor:pointer;
  display:flex;
  align-items:flex-start;
  transition:
    background .15s ease,
    box-shadow .15s ease,
    border-color .15s ease,
    transform .15s ease;
}
.fs3-qbox:hover{
  background:#FFFFFF;
  border-color:#3F52B3;
  box-shadow:0 4px 10px rgba(15,23,42,.08);
  transform:translateY(-1px);
}

.fs3-qtext{
  display:block;
  width:100%;
  white-space: pre-wrap;
  word-break: break-word;
}

/* pressed */
.fs3-qbox:active{
  background:#F9FAFB;
  border-color:#3F52B3;
  box-shadow:0 2px 6px rgba(15,23,42,.14);
  transform:translateY(0);
}

#fs3-left{ grid-column:1; grid-row:1; }
#fs3-right{ grid-column:1; grid-row:2; }

.fs3-qeq{
  grid-column:2;
  grid-row:1/3;
  align-self:stretch;
  justify-self:stretch;
  width:100%;
  min-height:64px;
  border-radius:14px;
  border:1px solid #CECFD9;
  background:#FFFFFF;
  cursor:pointer;
  font-size:20px;
  transition:
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease,
    border-color .18s ease;
  display:flex;
  align-items:center;
  justify-content:center;
}
.fs3-qeq:hover{
  background:#FFFFFF;
  border-color:#3F52B3;
  box-shadow:0 3px 8px rgba(56,46,44,.16);
  transform:translateY(-1px);
}
.fs3-qeq[disabled],
.fs3-qeq[disabled]:hover{
  opacity:.5;
  cursor:default;
  background:#CECFD9;
  border-color:#CECFD9;
  box-shadow:none;
  transform:none;
}
.fs3-qeq img{
  max-width:24px;
  max-height:24px;
  pointer-events:none;
  display:block;
  margin:0 auto;
}

/* pressed */
.fs3-qeq:active:not([disabled]){
  background:#F9FAFB;
  border-color:#3F52B3;
  box-shadow:0 2px 6px rgba(56,46,44,.2);
  transform:translateY(0);
}

/* compare actions (Back + Stop) */
.fs3-qactions{
  margin-top:24px;
  justify-content:flex-end;
  gap:16px;
}

/* =========================================================
   List
   ========================================================= */

.fs3-list{
  list-style:none;
  margin:0;
  padding:0;
}

.fs3-breadcrumb{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
  overflow-x:auto;
  overflow-y:hidden;
  margin:-14px 0 12px 0;
  padding-bottom:4px;
  font-size:13px;
  color:#858AA6;
  white-space:nowrap;
  scrollbar-width:thin;
  scrollbar-color:#C8CDE8 transparent;
  -webkit-overflow-scrolling:touch;
}
.fs3-breadcrumb::-webkit-scrollbar{
  height:4px;
}
.fs3-breadcrumb::-webkit-scrollbar-track{
  background:transparent;
}
.fs3-breadcrumb::-webkit-scrollbar-thumb{
  background:#C8CDE8;
  border-radius:999px;
}
.fs3-breadcrumb-btn{
  flex:0 1 auto;
  min-width:0;
  max-width:160px;
  overflow:hidden;
  border:none;
  background:transparent;
  color:#858AA6;
  cursor:pointer;
  padding:0;
  font:inherit;
  text-decoration:none;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.fs3-breadcrumb-back{
  border:none;
  background:transparent;
  color:#858AA6;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  padding:0;
  cursor:pointer;
}
@media (hover:hover) and (pointer:fine){
  .fs3-breadcrumb-back:hover{
    color:#3F52B3;
  }
  .fs3-breadcrumb-btn:hover{
    text-decoration:underline;
  }
}
.fs3-breadcrumb-btn:disabled{
  color:#858AA6;
  cursor:default;
  text-decoration:none;
}
.fs3-breadcrumb-sep{
  flex:0 0 auto;
  color:#858AA6;
}
.fs3-breadcrumb-branch-toggle{
  flex:0 0 auto;
  margin-left:auto;
  padding:0;
  border:none;
  background:transparent;
  color:#3F52B3;
  font:inherit;
  font-weight:600;
  cursor:pointer;
}

/* Root list renders only the toggle, so it should align to the left grid edge. */
.fs3-breadcrumb > .fs3-breadcrumb-branch-toggle:first-child{
  margin-left:0;
}
.fs3-breadcrumb-current{
  color:#858AA6;
}
#fs3-list.fs3-list{
  list-style:none;
  margin:0;
  padding-left:0 !important;
  padding-right:0;
}

.fs3-item-row{
  position:relative;
  margin:12px 0;
}

.fs3-rank{
  position:absolute;
  left:-48px;
  top:50%;
  transform:translateY(-50%);
  font-size:18px;
  font-weight:500;
  color:#CECFD9;
  width:40px;
  text-align:right;
  pointer-events:none;
}
.fs3-drop-marker .fs3-rank{ display:none; }

.fs3-item{
  width:100%;
  border:1px solid #CECFD9;
  border-radius:14px;
  padding:12px 20px;
  position:relative;
  overflow:visible;
  display:flex;
  align-items:center;
  gap:14px;
  background:#FFFFFF;
  transition:
    box-shadow .12s ease,
    transform .12s ease,
    border-color .12s ease,
    background .12s ease;
  cursor:grab;
}
.fs3-item:not(.fs3-editing):hover{
  box-shadow:0 3px 8px rgba(15,23,42,.08);
  transform:translateY(-1px);
  border-color:#CECFD9;
}
.fs3-item:active{ cursor:grabbing; }

.fs3-branch-mode .fs3-list{
  display:flex;
  gap:20px;
  align-items:flex-start;
  overflow:visible;
  width:max-content;
  min-width:100%;
  padding-bottom:8px;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

.fs3-branch-mode .fs3-list::-webkit-scrollbar{
  width:0;
  height:0;
}

@media (min-width: 769px){
  body.gf-branch-mode{
    overflow-x:hidden;
  }

  body.gf-branch-mode .fs3-shell{
    padding-bottom:0;
  }

  body.gf-branch-mode .fs3-list-wrap{
    width:100vw;
    max-width:100vw;
    min-width:0;
    height:calc(100vh - 224px);
    min-height:360px;
    margin-left:-60px;
    padding-left:60px;
    padding-right:24px;
    overflow-x:auto;
    overflow-y:auto;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
    -ms-overflow-style:none;
    padding-bottom:32px;
  }

  body.gf-branch-mode .fs3-list-wrap.fs3-list-wrap--drag-scrolling{
    user-select:none;
  }

  body.gf-branch-mode .fs3-list-wrap::-webkit-scrollbar{
    width:0;
    height:0;
  }
}

.fs3-branch-bottom-scrollbar{
  display:none;
  position:fixed;
  left:0;
  bottom:0;
  height:18px;
  overflow-x:scroll;
  overflow-y:hidden;
  background:#FFFFFF;
  z-index:2500;
}

.fs3-branch-bottom-scrollbar.show{
  display:block;
}

.fs3-branch-bottom-scrollbar-inner{
  height:1px;
}

/* Force hidden by default in branch mode; revealed only by hover/focus/import states below. */
.fs3-branch-mode .fs3-branch-card .fs3-branch-add-row{
  display:none;
  opacity:0;
  transform:translateY(4px);
}

.fs3-branch-mode #fs3-list-title,
.fs3-branch-mode .fs3-breadcrumb,
.fs3-branch-mode #fs3-copy-btn,
.fs3-branch-mode .fs3-body > .fs3-add-row{
  display:none !important;
}

.fs3-branch-mode #fs3-compare{
  display:none !important;
}

.fs3-branch-card{
  min-width:320px;
  width:320px;
  border:2px solid #CECFD9;
  border-radius:18px;
  padding:14px;
  background:#FFFFFF;
  flex:0 0 auto;
}

.fs3-branch-card:hover,
.fs3-branch-card:focus-within{
  border-color:#3F52B3;
}

.fs3-branch-card-title-input{
  width:100%;
  margin:0 0 12px;
  padding:0 0 2px;
  border:none;
  background:transparent;
  color:#12162E;
  font:600 20px/1.2 Noah,sans-serif;
  outline:none;
  resize:none;
  overflow:hidden;
  min-height:calc(1.2em + 4px);
  max-height:calc(1.2em * 2 + 6px);
  white-space:normal;
  word-break:break-word;
}

.fs3-branch-card-title-input:focus{
  border:none;
}

.fs3-branch-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.fs3-branch-card-actions{
  position:relative;
  display:flex;
  align-items:center;
  gap:8px;
}

/* Branch list controls stay quiet until the card is hovered or its title is being edited. */
.fs3-branch-mode .fs3-branch-card-actions > .fs3-icon-mini{
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease;
}
.fs3-branch-mode .fs3-branch-card:hover .fs3-branch-card-actions > .fs3-icon-mini,
.fs3-branch-mode .fs3-branch-card.fs3-branch-card--title-editing .fs3-branch-card-actions > .fs3-icon-mini{
  opacity:1;
  pointer-events:auto;
}

.fs3-branch-card-menu{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:220px;
  background:#fff;
  border:1px solid #CECFD9;
  border-radius:14px;
  box-shadow:0 12px 28px rgba(12,15,28,.14);
  padding:8px;
  z-index:10;
}

.fs3-branch-card-menu.show{
  display:block;
}

.fs3-branch-card-menu button{
  width:100%;
  border:none;
  background:transparent;
  text-align:left;
  padding:10px 12px;
  border-radius:10px;
  color:#0C0F1C;
  font:inherit;
  cursor:pointer;
}

@media (hover:hover) and (pointer:fine){
  .fs3-branch-card-menu button:hover{
    background:#F5F6FB;
  }
}

.fs3-branch-items{
  display:block;
}

.fs3-branch-add-row{
  display:block;
  margin-top:12px;
  opacity:1;
  transform:none;
}

.fs3-branch-add-input{
  width:100%;
  border:1px solid #CECFD9;
  border-radius:0;
  padding:16px;
  font:inherit;
  resize:none;
  overflow:hidden;
  min-height:64px;
  background:#FFFFFF;
  line-height:1.45;
}

.fs3-branch-add-input:focus{
  outline:none;
  border-color:#3F52B3;
}

.fs3-branch-add-actions{
  margin-top:12px;
  display:flex;
  align-items:stretch;
  gap:12px;
}

.fs3-branch-import-btn{
  flex:0 0 56px;
  width:56px;
  height:56px;
  border-radius:12px;
  border:1px solid #CECFD9;
  background:#FFFFFF;
}

.fs3-branch-add-btn{
  flex:1 1 auto;
  min-width:0;
  height:56px;
  min-height:56px;
  border-radius:9px;
  border:none;
  background:#3F52B3;
  color:#FFFFFF;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.fs3-branch-mode .fs3-item-row{
  position:relative;
  margin:12px 0 0;
}

.fs3-branch-mode .fs3-item{
  position:relative;
  padding:14px 16px 14px;
  border-radius:14px;
}

.fs3-branch-mode .fs3-rank{
  position:absolute;
  top:3px;
  left:50%;
  transform:translate(-50%, -50%);
  width:auto;
  padding:0 8px;
  text-align:center;
  font-size:12px;
  font-weight:500;
  line-height:1;
  color:#858AA6;
  background:#FFFFFF;
  pointer-events:none;
  z-index:1;
}

.fs3-branch-mode .fs3-item{
  cursor:grab;
}

.fs3-branch-mode .fs3-item:active{
  cursor:grabbing;
}

.fs3-branch-mode .fs3-item.fs3-branch-active-task{
  border-color:#3F52B3;
  box-shadow:0 0 0 1px rgba(63,82,179,.08) inset;
}

.fs3-branch-mode .fs3-item .fs3-icon-enter.fs3-branch-active-enter{
  border-color:#3F52B3;
}

.fs3-branch-mode .fs3-list{
  position:relative;
}

.fs3-branch-link-overlay{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:3;
}

.fs3-branch-mode .fs3-item-actions{
  opacity:1;
  pointer-events:auto;
}

.fs3-branch-mode .fs3-item-actions > button{
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease;
}

.fs3-branch-mode .fs3-item-row:hover .fs3-item-actions > button,
.fs3-branch-mode .fs3-item:focus-within .fs3-item-actions > button,
.fs3-branch-mode .fs3-item.fs3-editing .fs3-item-actions > button{
  opacity:1;
  pointer-events:auto;
}

.fs3-branch-mode .fs3-branch-card:hover .fs3-branch-add-row,
.fs3-branch-mode .fs3-branch-card:focus-within .fs3-branch-add-row,
.fs3-branch-mode .fs3-branch-card[data-importing='1'] .fs3-branch-add-row,
.fs3-branch-mode .fs3-branch-card[data-post-import-open='1'] .fs3-branch-add-row,
.fs3-branch-mode .fs3-branch-card.fs3-branch-card--composer-open .fs3-branch-add-row{
  display:block;
  opacity:1;
  transform:translateY(0);
}

@media (max-width: 768px){
  .fs3-breadcrumb{
    width:100%;
  }
  .fs3-breadcrumb-branch-toggle{
    margin-left:12px;
    white-space:nowrap;
  }
  .fs3-branch-card{
    min-width:280px;
    width:280px;
  }
}

@media (max-width: 768px) and (any-hover:none){
  .fs3-branch-add-row{
    display:block;
    opacity:1;
    transform:none;
  }
}

/* блокировка "руки" при выборе способа добавления */
.fs3.fs3-choosing .fs3-item{
  cursor:default;
}
.fs3.fs3-choosing .fs3-item:hover{
  box-shadow:none;
  transform:none;
  border-color:#CECFD9;
}

.fs3-item.fs3-editing{
  cursor:text;
  border-color:#3F52B3;
}
.fs3-item.fs3-editing .fs3-text{ cursor:text; }

.fs3-item-ghost{
  opacity:.9;
  box-shadow:0 8px 18px rgba(15,23,42,.25);
  transform:scale(1.01) translateY(-1px);
}

.fs3-text{
  flex:1;
  min-height:20px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size:16px;
  color:#0C0F1C;
}
.fs3-text:focus{ outline:none; }

/* управление выделением текста для мобильного/тача (общий безопасный вариант) */
.fs3-item,
.fs3-text{
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
  touch-action:manipulation;
}
.fs3-item.fs3-editing .fs3-text{
  -webkit-user-select:text;
  user-select:text;
  -webkit-touch-callout:default;
}

.fs3-item-actions{
  display:flex;
  gap:8px;
  flex-shrink:0;
}

/* Show task action buttons only on row hover for desktop pointers. */
@media (hover:hover) and (pointer:fine){
  .fs3-item-actions > button{
    opacity:0;
    pointer-events:none;
    transition:opacity .12s ease;
  }
  .fs3-item-row:hover .fs3-item-actions > button,
  .fs3-item:focus-within .fs3-item-actions > button,
  .fs3-item.fs3-editing .fs3-item-actions > button{
    opacity:1;
    pointer-events:auto;
  }
}

.fs3-icon-mini{
  width:32px;
  height:32px;
  border-radius:50%;
  border:none;
  background:transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:18px;
  color:#858AA6;
  transition:
    background .12s ease,
    color .12s ease,
    transform .12s ease;
}
.fs3-icon-mini:hover{
  background:rgba(0,0,0,0.03);
  color:#858AA6;
  transform:translateY(-1px);
}
.fs3-icon-mini:active{
  background:rgba(0,0,0,0.06);
  color:#858AA6;
  transform:translateY(0);
}
.fs3-icon-mini img{
  max-width:18px;
  max-height:18px;
  pointer-events:none;
}
.fs3-icon-trash{ font-size:18px; }
.fs3-item .fs3-icon-trash{
  display:none;
}
.fs3-item.fs3-editing .fs3-icon-trash{
  display:inline-flex;
}
.fs3-item .fs3-icon-enter{
  position:absolute;
  right:-12px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border-radius:50%;
  border:1px solid #CECFD9;
  background:#FFFFFF;
  z-index:2;
}
.fs3-item .fs3-icon-enter img{
  max-width:14px;
  max-height:14px;
}
/* Make "add nested list" plus icon slightly smaller than linked-list icon. */
.fs3-item .fs3-icon-enter:not(.has-child) img{
  max-width:11px;
  max-height:11px;
}
.fs3-icon-enter.has-child{
  background:#FFFFFF;
}

/* Keep action buttons shifted left from the nested-list circle. */
.fs3-item-actions > [data-action="edit"],
.fs3-item-actions > [data-action="save"],
.fs3-item-actions > [data-action="cancel"],
.fs3-item-actions > [data-action="delete"]{
  margin-right:6px;
}

/* Branch mode: keep save/delete/enter cluster tighter near the nested-list button. */
.fs3-branch-mode .fs3-item-actions > [data-action="edit"]{
  margin-right:10px;
}
.fs3-branch-mode .fs3-item-actions > [data-action="save"]{
  margin-right:2px;
}
.fs3-branch-mode .fs3-item-actions > [data-action="delete"]{
  margin-right:2px;
}

/* Branch mode: shift save/delete a bit left from the nested-list button while editing. */
.fs3-branch-mode .fs3-item.fs3-editing .fs3-item-actions > [data-action="save"]{
  transform:translateX(-2px);
}
.fs3-branch-mode .fs3-item.fs3-editing .fs3-item-actions > [data-action="delete"]{
  transform:translateX(-6px);
}

@media (hover:hover) and (pointer:fine){
  .fs3-item .fs3-icon-enter{
    opacity:0;
    pointer-events:none;
  }
  .fs3-item .fs3-icon-enter.has-child{
    opacity:1;
    pointer-events:auto;
  }
  .fs3-item-row:hover .fs3-icon-enter,
  .fs3-item:focus-within .fs3-icon-enter,
  .fs3-item.fs3-editing .fs3-icon-enter{
    opacity:1;
    pointer-events:auto;
  }
  .fs3-item .fs3-icon-enter:hover{
    border-color:#BFC6E8;
    background:#F4F6FF;
    transform:translateY(-50%);
  }
  .fs3-item .fs3-icon-enter:active{
    border-color:#BFC6E8;
    background:#EEF1FF;
    transform:translateY(-50%);
  }

}

/* Keep nested-list icon in standard blue for items that already have a child list. */
.fs3-item .fs3-icon-enter.has-child img{
  filter: invert(31%) sepia(32%) saturate(1468%) hue-rotate(208deg) brightness(89%) contrast(92%);
}

/* Match nested-list button border with task border in edit mode. */
.fs3-item.fs3-editing .fs3-icon-enter{
  border-color:#3F52B3;
}

/* =========================================================
   Add row
   ========================================================= */

.fs3-add-row{
  margin-top:24px;
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  align-items:flex-start;
  justify-content:flex-end;
}

.fs3-add-input{
  order:0;
  flex:1 1 100%;
  border:1px solid #CECFD9;
  border-radius:0;
  padding:16px;
  font:inherit;
  resize:none;
  overflow:hidden;
  min-height:56px;
  background:#FFFFFF;
  line-height:1.45;
}
.fs3-add-input:focus{
  outline:none;
  border-color:#3F52B3;
}

/* поле ввода не активно при выборе варианта */
.fs3.fs3-choosing .fs3-add-input{
  pointer-events:none;
  background:#F9FAFB;
}

#fs3-add-btn{
  order:2;
  height:56px;
  min-height:56px;
  padding-left:24px;
  padding-right:30px;
  border-radius:9px;
  border:none;
  background:#3F52B3;
  color:#FFFFFF;
  font-size:16px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-left:0;
  transition:
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease;
}
#fs3-add-btn:hover{
  background:#3F52B3;
  box-shadow:0 6px 16px rgba(56,46,44,.35);
  transform:translateY(-1px);
}
#fs3-add-btn:active:not([disabled]){
  background:#3F52B3;
  box-shadow:0 2px 6px rgba(56,46,44,.35);
  transform:translateY(0);
}
#fs3-add-btn span.fs3-add-plus{
  font-size:22px;
  margin-top:-2px;
}

#fs3-import-btn{
  order:1;
  border-radius:12px;
  border:1px solid #CECFD9;
  background:#FFFFFF;
  width:56px;
  height:56px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  color:#0C0F1C;
  cursor:pointer;
  flex-shrink:0;
  transition:
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease,
    border-color .18s ease;
}
/* hover/active для import уже есть в core через .fs3-icon-btn/#fs3-import-btn:hover */

/* ==== Вопрос "одна / несколько задач" ==== */
.fs3-add-choice{
  margin:18px 0 0 0;
  padding:0;
  border:none;
  background:transparent;
  display:none;
  width:fit-content;
  max-width:100%;
  margin-left:auto;
  text-align:right;
}
.fs3-add-choice-text{
  margin:0 0 12px 0;
  font-size:18px;
  font-weight:700;
  color:#0C0F1C;
}
.fs3-add-choice-buttons{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.fs3-add-choice-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid #3F52B3;
  padding:8px 20px;
  background:#FFFFFF;
  cursor:pointer;
  font-size:16px;
  font-weight:600;
  font-family:"Noah",sans-serif;
  color:#3F52B3;
  transition:
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease,
    border-color .18s ease,
    color .18s ease;
}
.fs3-add-choice-btn[data-mode="cancel"]{
  min-width:44px;
  padding:8px 14px;
  font-size:24px;
  line-height:1;
}
.fs3-add-choice-btn.primary{
  background:#3F52B3;
  color:#FFFFFF;
}
.fs3-add-choice-btn:not(.primary):hover{
  background:#FFFFFF;
  border-color:#3F52B3;
  box-shadow:0 2px 6px rgba(56,46,44,.14);
  transform:translateY(-1px);
  color:#3F52B3;
}
.fs3-add-choice-btn.primary:hover{
  background:#3F52B3;
  border-color:#3F52B3;
  color:#FFFFFF;
  box-shadow:0 3px 8px rgba(56,46,44,.2);
  transform:translateY(-1px);
}
.fs3-add-choice-btn:active{
  background:#F3F4F6;
  box-shadow:0 1px 3px rgba(56,46,44,.18);
  transform:translateY(1px);
}
.fs3-add-choice-btn.primary:active{
  background:#3F52B3;
  border-color:#3F52B3;
  color:#FFFFFF;
}

/* в режиме вопроса скрываем Скрепку и Добавить задачу */
.fs3.fs3-choosing #fs3-import-btn,
.fs3.fs3-choosing #fs3-add-btn{
  display:none;
}

/* =========================================================
   Drag & drop marker
   ========================================================= */

.fs3-drop-marker{
  display:none;
  margin:12px 0;
  transition:all .12s ease;
}
.fs3-drop-marker.show{
  display:flex;
}
.fs3-item-placeholder{
  flex:1;
  border-radius:14px;
  border:2px dashed #CECFD9;
  background:rgba(156,163,175,0.05);
  min-height:44px;
}

/* =========================================================
   App states
   ========================================================= */

.fs3-asking .fs3-card:nth-of-type(2){
  opacity:.3;
}
.fs3-asking .fs3-header,
.fs3-asking .fs3-list-wrap,
.fs3-asking .fs3-add-row{
  pointer-events:none;
}

/* =========================================================
   Toast
   ========================================================= */

.fs3-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: #3F52B3;
  color: #fff;
  font-size: 14px;
  font-family: "Noah", sans-serif;
  box-shadow: 0 10px 25px rgba(56,46,44,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
}
.fs3-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* =========================================================
   Reset modal: "Delete all tasks?"
   ========================================================= */

.fs3-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.35);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9998;
  font-family:"Noah", sans-serif;
}
.fs3-modal-backdrop.show{
  display:flex;
}

.fs3-modal{
  background:#FFFFFF;
  padding:48px 60px;
  box-shadow:0 18px 45px rgba(15,23,42,.35);
  max-width:480px;
  width:auto;
  font-family:"Noah", sans-serif;
}

.fs3-modal p.fs3-modal-title,
.fs3-modal #fs3-modal-title.fs3-modal-title{
  margin:0 0 28px 0;
  font-family:"Noah", sans-serif;
  font-size:32px;
  font-weight:800;
  line-height:1.1;
  letter-spacing:-0.02em;
  color:#0C0F1C;
}

.fs3-modal-actions{
  display:flex;
  gap:12px;
  margin-top:12px;
}

/* Stack delete-modal actions vertically on desktop and mobile. */
#fs3-modal-backdrop .fs3-modal-actions{
  flex-direction:column;
  gap:16px;
}

.fs3-modal-btn{
  min-height:60px;
  padding:0 32px;
  border-radius:9px;
  font-size:16px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:"Noah", sans-serif;
  transition:
    background .18s ease,
    box-shadow .18s ease,
    transform .18s ease,
    border-color .18s ease,
    color .18s ease;
}

#fs3-modal-backdrop .fs3-modal-btn{
  width:100%;
}

.fs3-modal-btn.primary{
  background:#3F52B3;
  color:#FFFFFF;
  border:none;
}
.fs3-modal-btn.primary:hover{
  background:#3F52B3;
  box-shadow:0 6px 16px rgba(56,46,44,.35);
  transform:translateY(-1px);
}
.fs3-modal-btn.primary:active{
  background:#3F52B3;
  box-shadow:0 2px 6px rgba(56,46,44,.35);
  transform:translateY(0);
}

.fs3-modal-btn.secondary{
  background:#FFFFFF;
  color:#3F52B3;
  border:1px solid #3F52B3;
}
.fs3-modal-btn.secondary:hover{
  background:#FFFFFF;
  color:#3F52B3;
  border-color:#3F52B3;
  box-shadow:0 4px 10px rgba(56,46,44,.20);
  transform:translateY(-1px);
}
.fs3-modal-btn.secondary:active{
  background:#F9FAFB;
  border-color:#3F52B3;
  box-shadow:0 2px 6px rgba(56,46,44,.25);
  transform:translateY(0);
}

/* =========================================================
   Account popup (logged-in): scoped overrides
   (do not affect other fs3 modals)
   ========================================================= */

#gf-account-backdrop{
  display:none;
}

#gf-account-backdrop[aria-hidden="false"]{
  display:flex;
}

#gf-account-backdrop .gf-account-modal{
  padding:32px 36px;
  max-width:480px;
  width:auto;
  position:relative;
  box-sizing:border-box;
}

#gf-account-backdrop #gf-account-title{
  font-size:16px;
  font-weight:700;
}

#gf-account-backdrop #gf-account-id{
  font-size:16px;
  font-weight:400;
  margin-top:16px;
}

#gf-account-backdrop .gf-account-actions{
  margin-top:20px;
  display:flex;
  justify-content:center;
}

#gf-account-backdrop #gf-account-logout{
  min-width:215px;
}

@media (max-width: 768px){
  body.gf-branch-mode .fs3-body{
    padding-left:0 !important;
    padding-right:0 !important;
    overflow-x:hidden;
  }

  body.gf-branch-mode .fs3-list-wrap{
    width:100vw;
    max-width:100vw;
    margin-left:calc(50% - 50vw);
    overflow-x:auto;
    overflow-y:visible;
    scroll-snap-type:x mandatory;
    scroll-padding-inline:32px;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    touch-action:pan-x pan-y;
    scrollbar-width:none;
    -ms-overflow-style:none;
  }

  body.gf-branch-mode .fs3-list-wrap::-webkit-scrollbar{
    width:0;
    height:0;
  }

  .fs3-branch-mode .fs3-list{
    min-width:0;
    width:max-content;
    padding:0 32px 8px;
    overflow:visible;
    scroll-snap-type:x mandatory;
    touch-action:pan-x pan-y;
  }

  .fs3-branch-mode .fs3-branch-card{
    width:calc(100vw - 64px);
    min-width:calc(100vw - 64px);
    scroll-snap-align:center;
    scroll-snap-stop:always;
  }

  body.gf-branch-mode .fs3-item{
    touch-action:pan-x pan-y;
  }
}

@media (max-width: 768px){
  body.gf-branch-mode .fs3-header-right{
    padding-left:20px;
    padding-right:20px;
  }

  body.gf-branch-mode #fs3-list.fs3-list{
    padding-left:32px !important;
    padding-right:32px !important;
  }

  .fs3-branch-mode .fs3-branch-card-actions > .fs3-icon-mini,
  .fs3-branch-mode .fs3-item-actions > button{
    opacity:1;
    pointer-events:auto;
  }

  body.gf-branch-mode .fs3-branch-card .fs3-branch-add-row{
    display:block;
    opacity:1;
    transform:none;
  }
}

@media (max-width: 768px){
  body.gf-branch-mode .fs3-header-right{
    gap:12px;
    justify-content:flex-start;
  }

  body.gf-branch-mode #fs3-share-btn,
  body.gf-branch-mode #fs3-reset-btn{
    display:inline-flex !important;
    margin-right:0;
  }

  body.gf-branch-mode #fs3-save-btn,
  body.gf-branch-mode #fs3-new-list-btn{
    margin-right:0;
  }

  body.gf-branch-mode #fs3-header-more,
  body.gf-branch-mode #fs3-header-menu{
    display:none !important;
  }
}

/* Branch-card comparison mode: only the selected card stays visually active, but cards do not accept input. */
.fs3-branch-mode.fs3-branch-comparing .fs3-header-right{
  display:none !important;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card{
  pointer-events:none;
  opacity:.2;
  transition:none;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card.fs3-branch-compare-target{
  opacity:1;
  border-color:#3F52B3;
}


.fs3-branch-mode.fs3-branch-comparing .fs3-branch-link-overlay{
  opacity:.18;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card:hover,
.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card:focus-within{
  border-color:#CECFD9;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card.fs3-branch-compare-target:hover,
.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card.fs3-branch-compare-target:focus-within{
  border-color:#3F52B3;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-branch-card-actions > .fs3-icon-mini,
.fs3-branch-mode.fs3-branch-comparing .fs3-item-actions > button:not([data-action="enter"]),
.fs3-branch-mode.fs3-branch-comparing .fs3-branch-add-row{
  opacity:0 !important;
  pointer-events:none !important;
}

.fs3-branch-mode.fs3-branch-comparing .fs3-item-actions > [data-action="enter"]{
  opacity:1 !important;
  pointer-events:none !important;
}
