/* FIS identity panel, docked in the convert header (see includes/site_nav.php). */
#fis-panel {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: inherit;
}

#fis-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 138, 94, 0.35);
  border-radius: 22px;
  padding: 0.25rem 0.75rem 0.25rem 0.35rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
#fis-header:hover,
#fis-header:focus-visible {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(45, 138, 94, 0.18);
  outline: none;
}
#fis-panel.identified #fis-header {
  background: rgba(45, 138, 94, 0.12);
  border-color: var(--accent);
}

#fis-header-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#fis-header-icon svg {
  width: 28px;
  height: 28px;
}

#fis-header-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  max-width: 11em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#fis-header-arrow {
  font-size: 0.55rem;
  color: var(--accent);
  transition: transform 0.25s;
}
#fis-panel.open #fis-header-arrow {
  transform: rotate(180deg);
}

/* Dropdown anchored under the pill; the header carries a higher z-index than .convert-main. */
#fis-body {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 22rem;
  max-width: calc(100vw - 2rem);
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  padding: 1rem;
  background: var(--surface-solid);
  border: 1px solid rgba(45, 138, 94, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 60, 90, 0.22);
  text-align: left;
  color: var(--text);
}
#fis-panel.open #fis-body {
  display: block;
}

#fis-intro {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

#fis-body table {
  width: 100%;
  border-collapse: collapse;
}
#fis-body td {
  background: rgba(126, 207, 255, 0.12);
  padding: 0.6rem;
  border-radius: 8px;
  vertical-align: top;
}

#fis-body textarea {
  overflow: hidden;
  resize: horizontal;
  min-width: 10rem;
  width: auto;
  height: 28px;
  min-height: 28px;
  padding: 0.25rem 0.4rem;
  line-height: 1.4;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(45, 138, 94, 0.45);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  display: block;
  margin-bottom: 0.25rem;
  box-sizing: border-box;
}
#fis-body input[type="password"] {
  min-width: 10rem;
  padding: 0.25rem 0.4rem;
  background: #fff;
  color: var(--text);
  border: 1px solid rgba(90, 112, 136, 0.45);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  outline: none;
  display: block;
  margin-bottom: 0.25rem;
}
#fis-body textarea:focus,
#fis-body input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(45, 138, 94, 0.18);
}

#fis-body .component_controls,
#fis-body .identity_controls {
  font-size: 0.65rem;
  color: var(--muted);
}
#fis-body .component_controls span,
#fis-body .identity_controls span {
  cursor: pointer;
}
#fis-body .component_controls span:hover,
#fis-body .identity_controls span:hover {
  color: var(--accent);
}

#fis-body .add_text,
#fis-body .add_password,
#fis-body .add_image,
#fis-body .add_clickset,
#fis-body .add_charset,
#fis-body .add_document {
  display: inline-block;
  margin: 0.15rem 0.2rem 0.15rem 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(90, 112, 136, 0.3);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}
#fis-body .add_text:hover,
#fis-body .add_password:hover,
#fis-body .add_image:hover,
#fis-body .add_document:hover,
#fis-body .add_charset:hover,
#fis-body .add_clickset:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

#identity_information {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1em;
}
#identity_information .fis-ok {
  color: var(--accent);
  font-weight: 600;
}
#identity_information .fis-warn {
  color: #a8681a;
}

#fis-hint {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(90, 112, 136, 0.18);
  font-size: 0.7rem;
  color: var(--muted);
}
#fis-hint a {
  color: var(--accent);
}

/* Narrow screens: drop the sheet across the header instead of a 22rem card. */
@media (max-width: 640px) {
  #fis-panel {
    position: static;
  }
  #fis-body {
    top: calc(100% - 0.25rem);
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-width: none;
  }
}
