/* ============================================================
   Demo 5 — AI Form Template Generator
   Owned solely by this demo. All selectors are prefixed `ft-`
   so they cannot collide with the other demos' global styles.
   Builds on the shared tokens/components in main.css.
   ============================================================ */

/* ---- Upload phase ---- */
.ft-upload-card { max-width: 760px; margin: 0 auto; }

/* NLP "describe the form" path */
.ft-gen-lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.ft-gen-lbl svg { color: var(--asite-blue); }
.ft-nlp { margin-bottom: 6px; }
.ft-nlp-input { width: 100%; min-height: 76px; resize: vertical; }
.ft-nlp-ex-lbl {
  margin: 12px 0 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ft-nlp-ex { display: flex; flex-direction: column; gap: 7px; }
.ft-ex-chip {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--asite-blue-light);
  border: 1px solid #cfe0f5;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ft-ex-chip:hover { background: #D5E6FA; border-color: #BBD6F5; }
.ft-ex-chip svg { color: var(--asite-blue); flex-shrink: 0; margin-top: 2px; }
.ft-nlp-go { width: 100%; margin-top: 12px; }
.ft-gen-sub-prompt {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  font-style: italic;
}

.ft-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 34px 20px 28px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
}
.ft-drop-ic {
  width: 64px; height: 64px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
  margin-bottom: 8px;
}
.ft-drop-t { font-size: 15px; font-weight: 700; color: var(--text); }
.ft-drop-s { font-size: 12px; color: var(--text-3); }
.ft-browse { margin-top: 12px; }

.ft-sample-lbl {
  margin: 20px 0 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  position: relative;
}

/* ---- Generating phase (reuses the metadata-qa visual language) ---- */
.ft-gen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 38px 20px 32px;
}
.ft-orb {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
  animation: ft-pulse 1.5s ease-out infinite;
}
@keyframes ft-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(91,108,184,.40); }
  70%  { box-shadow: 0 0 0 18px rgba(91,108,184,0); }
  100% { box-shadow: 0 0 0 0 rgba(91,108,184,0); }
}
.ft-gen-title { font-size: 16px; font-weight: 700; margin-top: 16px; }
.ft-gen-sub { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }

.ft-steps {
  margin-top: 22px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.ft-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 12.5px;
  color: var(--text-3);
  transition: color .2s, border-color .2s, background .2s;
}
.ft-step-ic { display: flex; color: var(--text-3); transition: color .2s; }
.ft-step-t { flex: 1; min-width: 0; }
.ft-step-state {
  width: 16px; height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: #6D5BD0;
  animation: ft-spin .7s linear infinite;
}
@keyframes ft-spin { to { transform: rotate(360deg); } }
.ft-step.done {
  color: var(--text);
  border-color: #C2E5D2;
  background: var(--ok-bg);
}
.ft-step.done .ft-step-ic { color: var(--ok); }
.ft-step.done .ft-step-state {
  border: none;
  background: var(--ok);
  animation: none;
  position: relative;
}
.ft-step.done .ft-step-state::after {
  content: "";
  position: absolute;
  left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---- Editor layout ---- */
.ft-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 960px) {
  .ft-layout { grid-template-columns: 1fr; }
}
.ft-col-chat { position: sticky; top: 16px; }
@media (max-width: 960px) {
  .ft-col-chat { position: static; }
}

/* ---- Rendered form preview ---- */
.ft-form-head { justify-content: space-between; }
.ft-form-body { padding: 18px; }
.ft-form { display: flex; flex-direction: column; gap: 14px; }

.ft-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
}
.ft-flabel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ft-req { color: var(--err); font-weight: 700; }

/* Unified create page: Name + Category fields sit above the AI generator. */
.ft-create-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 2px;
}
.ft-create-field { display: flex; flex-direction: column; min-width: 0; }
.ft-create-field .ft-modal-lbl { margin-top: 0; }
.ft-create-sep {
  height: 1px;
  background: var(--line);
  margin: 16px 0 14px;
}
@media (max-width: 560px) {
  .ft-create-grid { grid-template-columns: 1fr; }
}
.ft-tag-new {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #4F3FB0;
  background: #ECE9FB;
  padding: 1px 7px;
  border-radius: 999px;
}
.ft-field .field { width: 100%; }
.ft-textarea { min-height: 64px; resize: none; }

.ft-date { position: relative; }
.ft-date .field { padding-right: 34px; }
.ft-date-ic {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: flex;
}

.ft-file {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  color: var(--text-3);
}
.ft-file-ic {
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: var(--asite-blue);
  background: var(--asite-blue-light);
}
.ft-file-t { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ft-file-s { font-size: 11.5px; color: var(--text-3); margin-left: auto; }

.ft-checks { display: flex; flex-direction: column; gap: 7px; }
.ft-check { font-size: 13px; color: var(--text-2); }

.ft-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.ft-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ft-table th {
  text-align: left;
  background: var(--bg-sunken);
  color: var(--text-2);
  font-weight: 700;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ft-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.ft-table tbody tr:last-child td { border-bottom: none; }
.ft-cell { display: block; height: 9px; border-radius: 2px; background: #eef1f5; }

/* ---- Interactive (real) controls ---- */
.ft-date-input { cursor: text; }
.ft-date-input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.ft-date-input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

.ft-file { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ft-file:hover { border-color: var(--asite-blue); background: var(--asite-blue-light); }
.ft-file.has-file { border-style: solid; border-color: var(--asite-blue); background: var(--asite-blue-light); }
.ft-file.has-file .ft-file-t { color: var(--text); }
.ft-file.has-file .ft-file-s { color: var(--asite-blue); font-weight: 600; }

.ft-table-edit td { padding: 0; }
.ft-cell-input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.ft-cell-input:focus { background: var(--asite-blue-light); box-shadow: inset 0 0 0 1.5px var(--asite-blue); border-radius: 3px; }
.ft-table-edit td:not(:last-child) { border-right: 1px solid var(--line-soft); }

.ft-addrow { margin-top: 8px; }

.ft-drop { cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.ft-drop:hover { border-color: var(--asite-blue); }
.ft-drop.drag { border-color: var(--asite-blue); background: var(--asite-blue-light); }

/* New / changed field flash */
.ft-field.flash {
  animation: ft-flash 1.3s ease-out;
}
@keyframes ft-flash {
  0%   { background: #ECE9FB; border-color: #c4cbe6; }
  100% { background: transparent; border-color: transparent; }
}

.ft-form-note { margin-top: 16px; }

/* ---- Chat panel ---- */
.ft-chat-card { display: flex; flex-direction: column; max-height: calc(100vh - 150px); overflow: hidden; }
.ft-chat-head { gap: 10px; }
.ft-chat-ava {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
}

.ft-chat-log {
  flex: 1;
  min-height: 260px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-sunken);
}

.ft-msg { display: flex; align-items: flex-start; gap: 8px; }
.ft-msg.user { flex-direction: row-reverse; }
.ft-ava {
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.ft-ava-ai { background: linear-gradient(135deg, #6D5BD0, #4F3FB0); }
.ft-ava-u  { background: linear-gradient(135deg, #C98A14, #9A6A0F); }

.ft-bubble {
  max-width: 80%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: var(--sh-1);
}
.ft-msg.ai .ft-bubble {
  background: #fff;
  color: var(--text);
  border-top-left-radius: 3px;
}
.ft-msg.user .ft-bubble {
  background: var(--asite-blue);
  color: #fff;
  border-top-right-radius: 3px;
}

.ft-typing { display: flex; align-items: center; gap: 4px; padding: 12px; }
.ft-typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  animation: ft-bounce 1s infinite ease-in-out;
}
.ft-typing span:nth-child(2) { animation-delay: .15s; }
.ft-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ft-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.ft-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ft-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--asite-blue-text);
  background: var(--asite-blue-light);
  border: 1px solid #d3e2f5;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.ft-chip:hover { background: #D5E6FA; border-color: #BBD6F5; }

.ft-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.ft-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  outline: none;
  font-size: 13px;
  transition: border-color .12s, box-shadow .12s;
}
.ft-input:focus {
  border-color: var(--asite-blue);
  box-shadow: 0 0 0 3px rgba(0,114,206,.14);
}
.ft-send {
  width: 40px;
  padding: 0;
  flex-shrink: 0;
}

/* ============================================================
   PHASE: hub — the Asite "Form Templates → All Templates"
   landing that opens before the AI generator. Presentational
   product chrome; only "Create New" is interactive.
   ============================================================ */
.ft-hub {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
}

/* ---- browser-style product tab strip ---- */
.ft-hub-apptabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  padding: 0 10px;
  background: #e9edf2;
  border-bottom: 1px solid var(--line);
}
.ft-hub-apptabs-l { display: flex; align-items: center; gap: 4px; }
.ft-apptab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.ft-apptab-ic { display: inline-flex; color: var(--text-3); }
.ft-apptab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 -1px 0 var(--line);
}
.ft-apptab.active .ft-apptab-ic { color: #6D5BD0; }
.ft-apptab-x { display: inline-flex; color: var(--text-3); margin-left: 4px; }
.ft-apptab-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--text-3);
}
.ft-hub-apptabs-r { display: flex; align-items: center; gap: 12px; }
.ft-disc {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--asite-blue-text);
  white-space: nowrap;
}
.ft-apptab-ic2 { display: inline-flex; color: var(--text-3); }

/* ---- dark-navy product bar ---- */
.ft-hub-navy {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 50px;
  padding: 0 14px;
  color: #fff;
  background: var(--asite-navy);
}
.ft-hub-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
}
.ft-hub-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 230px;
  height: 30px;
  flex-shrink: 0;
  padding: 0 11px;
  border-radius: 6px;
  background: rgba(255,255,255,.94);
  color: var(--text-3);
  font-size: 12.5px;
}
.ft-hub-proj {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  opacity: .95;
  white-space: nowrap;
  overflow: hidden;
}
.ft-hub-proj strong {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ft-hub-navtools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}
.ft-hub-ic { display: inline-flex; opacity: .9; }
.ft-flag {
  width: 22px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 2px;
  background-color: #012169;
  background-image:
    linear-gradient(to right, transparent 44%, #C8102E 44%, #C8102E 56%, transparent 56%),
    linear-gradient(to bottom, transparent 44%, #C8102E 44%, #C8102E 56%, transparent 56%),
    linear-gradient(to right, transparent 38%, #fff 38%, #fff 62%, transparent 62%),
    linear-gradient(to bottom, transparent 38%, #fff 38%, #fff 62%, transparent 62%),
    linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%),
    linear-gradient(135deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
}
.ft-ava-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #E8943A, #C2751C);
}

/* ---- product sub-navigation ---- */
.ft-hub-subnav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.ft-subtab {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.ft-subtab:hover { color: var(--text); }
.ft-subtab.active {
  color: #4F3FB0;
  border-bottom-color: #6D5BD0;
  font-weight: 700;
}

/* ---- All Templates content ---- */
.ft-hub-content { padding: 18px 18px 8px; background: #fff; }

.ft-hub-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ft-hub-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding-top: 4px;
}
.ft-hub-toolbar-r {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ft-hub-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.ft-hub-userfind {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-3);
}
.ft-hub-userinput {
  border: none;
  outline: none;
  font: inherit;
  font-size: 13px;
  width: 120px;
  background: transparent;
  color: var(--text);
}
.ft-hub-iconbtn,
.ft-hub-exportbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.ft-hub-iconbtn { padding: 0 10px; }
.ft-hub-iconbtn:hover,
.ft-hub-exportbtn:hover { border-color: var(--asite-blue); color: var(--asite-blue-text); }
.ft-hub-createbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(79,63,176,.3);
  transition: filter .12s;
}
.ft-hub-createbtn:hover { filter: brightness(1.06); }
.ft-hub-viewtoggle {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ft-hub-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 100%;
  color: var(--text-3);
  cursor: pointer;
}
.ft-hub-view + .ft-hub-view { border-left: 1px solid var(--line); }
.ft-hub-view.active { background: var(--asite-blue-light); color: var(--asite-blue-text); }
.ft-hub-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--asite-blue-text);
  cursor: pointer;
}

/* ---- template grid ---- */
.ft-hub-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .ft-hub-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px)  { .ft-hub-grid { grid-template-columns: repeat(2, 1fr); } }

.ft-tpl-card {
  display: flex;
  flex-direction: column;
  min-height: 198px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
.ft-tpl-card:hover { box-shadow: var(--sh-2); border-color: var(--line-strong); }
.ft-tpl-top { display: flex; align-items: center; justify-content: space-between; }
.ft-tpl-cb {
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--line-strong);
  border-radius: 3px;
}
.ft-tpl-top-r { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.ft-tpl-ic { display: inline-flex; }
.ft-tpl-thumb {
  margin: 8px 0 10px;
  height: 78px;
  border-radius: var(--r-sm);
  background: var(--asite-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ft-tpl-doc { display: inline-flex; color: var(--asite-blue); }
.ft-tpl-google {
  flex-direction: column;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
}
.ft-tpl-gtext {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.5px;
  background: linear-gradient(90deg, #4285F4, #EA4335 38%, #FBBC05 58%, #34A853);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ft-tpl-gbar {
  width: 78%;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 7px;
  color: var(--text-3);
}
.ft-tpl-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ft-tpl-cat { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.ft-tpl-card.is-new { border-color: #C4BBEA; box-shadow: 0 0 0 1px #C4BBEA inset; }
.ft-tpl-newtag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #4F3FB0;
  background: #ECE9FB;
  border-radius: 999px;
  vertical-align: middle;
}
.ft-tpl-mod { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.ft-tpl-status { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.ft-tpl-status.draft { color: #B26B00; }

/* leading "Create New" card */
.ft-tpl-new {
  align-items: center;
  justify-content: center;
  gap: 12px;
  font: inherit;
  text-align: center;
  border: 2px dashed #C4BBEA;
  background: #FAF9FE;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ft-tpl-new:hover { border-color: #6D5BD0; background: #F3F0FC; }
.ft-tpl-newcirc {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4F3FB0;
  background: #ECE9FB;
  border: 1.5px solid #C4BBEA;
}
.ft-tpl-newlbl { font-size: 14px; font-weight: 700; color: #4F3FB0; }

/* ---- pager ---- */
.ft-hub-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 6px;
  padding: 16px 2px 8px;
  font-size: 12.5px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.ft-hub-pager-l,
.ft-hub-pager-r { display: flex; align-items: center; gap: 8px; }
.ft-hub-pager-c { color: var(--text-3); }
.ft-hub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text-2);
  cursor: pointer;
}
.ft-hub-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--text-3);
  cursor: pointer;
}

/* ---- floating chat bubble ---- */
.ft-hub-bubble {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #2f9c8f, #1f7d72);
  box-shadow: var(--sh-2);
  cursor: pointer;
}

/* ============================================================
   "Create a Form Template" modal
   ============================================================ */
.ft-modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10,46,82,.45);
}
.ft-modal {
  width: 100%;
  max-width: 460px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px rgba(10,46,82,.3);
  overflow: hidden;
  animation: ft-modal-in .18s ease-out;
}
@keyframes ft-modal-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.ft-modal-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  padding: 20px 22px 2px;
}
.ft-modal-body { padding: 8px 22px 6px; }
.ft-modal-lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 14px 0 6px;
}
.ft-modal-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.ft-modal-input:focus {
  border-color: #6D5BD0;
  box-shadow: 0 0 0 3px rgba(109,91,208,.15);
}
.ft-modal-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-3);
  font-size: 13.5px;
  cursor: pointer;
}
.ft-modal-select-wrap {
  position: relative;
}
.ft-modal-select-input {
  width: 100%;
  cursor: pointer;
  background: #fff;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px;
}
.ft-modal-select-input.is-ph {
  color: var(--text-3);
}
.ft-modal-select-ic {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  display: inline-flex;
}
.ft-modal-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 22px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  color: var(--text-3);
}
.ft-modal-drop-ic {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4F3FB0;
  background: #ECE9FB;
}
.ft-modal-drop-t { font-size: 12.5px; color: var(--text-3); }
.ft-modal-drop-link {
  color: #4F3FB0;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.ft-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 20px;
}
.ft-modal-cancel {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #4F3FB0;
}
.ft-modal-go {
  height: 40px;
  padding: 0 22px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #6D5BD0, #4F3FB0);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .12s;
}
.ft-modal-go:hover { filter: brightness(1.06); }
.ft-modal-go:disabled {
  background: #C9C4E4;
  cursor: not-allowed;
  filter: none;
}

/* ============================================================
   Shell breadcrumb — shown inside the shell on the
   create / generate / editor steps so they read as a sub-page
   of the Asite "Form Templates" section.
   ============================================================ */
.ft-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  min-width: 0;
}
.ft-crumb-root {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #4F3FB0;
  cursor: pointer;
}
.ft-crumb-root:hover { text-decoration: underline; }
.ft-crumb-sep { display: inline-flex; flex-shrink: 0; color: var(--text-3); }
.ft-crumb-cur {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The editor renders inside the shell but keeps its sticky chat column, which
   an overflow:hidden ancestor would silently disable. This variant drops the
   clipping and instead rounds the top tab strip to match the shell's corners. */
.ft-hub--flow { overflow: visible; }
.ft-hub--flow .ft-hub-apptabs {
  border-top-left-radius: calc(var(--r-lg) - 1px);
  border-top-right-radius: calc(var(--r-lg) - 1px);
}
