.sfinder {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  color: #172033;
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
}

.sfinder__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.sfinder__title {
  margin: 0;
  color: #123b69;
  font-size: 1.7rem;
  font-weight: 700;
}

.sfinder__nav {
  margin: 0.35rem 0 0;
  color: #42526b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.sfinder__nav a {
  color: #1f4f86;
  text-underline-offset: 0.12em;
}

.sfinder__status {
  min-width: 14rem;
  min-height: 1.35rem;
  margin: 0.2rem 0 0;
  color: #37506f;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: right;
}

.sfinder-panel {
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

.sfinder-panel--search {
  padding: 1rem;
}

.sfinder-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 8px 8px 0 0;
}

.sfinder-panel__head h2 {
  margin: 0;
  font-size: 1rem;
  color: #172033;
}

.sfinder-grid {
  display: grid;
  gap: 0.75rem;
}

.sfinder-grid--primary {
  grid-template-columns: minmax(18rem, 1.4fr) minmax(18rem, 1fr) 6rem 8rem;
  align-items: end;
}

.sfinder-grid--advanced {
  grid-template-columns: repeat(4, minmax(12rem, 1fr));
  margin-top: 0.85rem;
}

.sfinder-field,
.sfinder-select,
.sfinder-multiselect {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.sfinder-field span,
.sfinder-select span,
.sfinder-control-label {
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
}

.sfinder-field input,
.sfinder-select select,
.sfinder-multiselect__toggle {
  width: 100%;
  min-height: 2.45rem;
  border: 1px solid #b9c4d2;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 0.94rem;
  padding: 0.5rem 0.65rem;
}

.sfinder-multiselect--wide {
  grid-column: span 2;
}

.sfinder-multiselect__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  text-align: left;
  cursor: pointer;
}

.sfinder-multiselect__toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #475569;
  border-bottom: 2px solid #475569;
  transform: translateY(-0.12rem) rotate(45deg);
  flex: 0 0 auto;
}

.sfinder-multiselect.is-open .sfinder-multiselect__toggle::after {
  transform: translateY(0.12rem) rotate(225deg);
}

.sfinder-field input:focus,
.sfinder-select select:focus,
.sfinder-multiselect__toggle:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 0;
  border-color: #2f6aa3;
}

.sfinder-modal-open {
  overflow: hidden;
}

.sfinder-choice-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 2.5vh 2vw;
}

.sfinder-choice-modal[hidden] {
  display: none;
}

.sfinder-choice-modal__panel {
  width: min(96vw, 1440px);
  max-height: 92vh;
  border: 1px solid #b9c4d2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.sfinder-choice-modal--xpos .sfinder-choice-modal__panel {
  width: min(90vw, 1296px);
}

.sfinder-choice-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d5dbe5;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}

.sfinder-choice-modal__head h2 {
  margin: 0;
  color: #172033;
  font-size: 1rem;
}

.sfinder-choice-modal__count {
  display: block;
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
}

.sfinder-choice-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.sfinder-choice-modal__options {
  max-height: calc(92vh - 4.5rem);
  overflow: auto;
  column-width: 11rem;
  column-gap: 0.75rem;
  padding: 0.75rem;
}

.sfinder-choice-modal__options--xpos {
  column-width: auto;
  padding-inline: 1rem;
}

.sfinder-choice-groups--xpos {
  display: grid;
  grid-template-columns: repeat(7, max-content);
  column-gap: 2rem;
  row-gap: 0.25rem;
  align-items: start;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

.sfinder-choice-group {
  min-width: 0;
}

.sfinder-choice-option {
  break-inside: avoid;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.95rem;
  border-radius: 6px;
  color: #172033;
  font-size: 0.84rem;
  font-weight: 750;
  margin: 0 0 0.12rem;
  padding: 0.22rem 0.35rem;
  cursor: pointer;
}

.sfinder-choice-option--xpos {
  color: #172033;
}

.sfinder-choice-option--xpos span {
  color: var(--sfinder-option-color, #172033);
  font-weight: 900;
}

.sfinder-choice-option--tone-red {
  --sfinder-option-color: #ff0000;
}

.sfinder-choice-option--tone-orange {
  --sfinder-option-color: #ff8000;
}

.sfinder-choice-option--tone-green {
  --sfinder-option-color: #009900;
}

.sfinder-choice-option--tone-blue {
  --sfinder-option-color: #0000ff;
}

.sfinder-choice-option--tone-light-blue {
  --sfinder-option-color: #52b1ff;
}

.sfinder-choice-option--tone-black {
  --sfinder-option-color: #000000;
}

.sfinder-choice-option--tone-brown {
  --sfinder-option-color: #a05028;
}

.sfinder-choice-option--tone-gray {
  --sfinder-option-color: #969696;
}

.sfinder-choice-option--tone-punctuation {
  --sfinder-option-color: #000000;
}

.sfinder-choice-option--tone-light-light-blue {
  --sfinder-option-color: #c0ebff;
}

.sfinder-choice-option--tone-light-light-red {
  --sfinder-option-color: #ff7088;
}

.sfinder-choice-option--tone-hot-pink {
  --sfinder-option-color: #ff00c0;
}

.sfinder-choice-option:hover,
.sfinder-choice-option:focus-within {
  background: #eef6ff;
}

.sfinder-choice-option input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: #167042;
}

.sfinder-field--compact input {
  text-align: right;
}

.sfinder-btn {
  min-height: 2.45rem;
  border: 1px solid #a6b3c4;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.48rem 0.7rem;
  cursor: pointer;
}

.sfinder-btn:hover:not(:disabled) {
  border-color: #64748b;
  background: #eef2f7;
}

.sfinder-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sfinder-btn--primary {
  border-color: #14532d;
  background: #167042;
  color: #ffffff;
}

.sfinder-btn--primary:hover:not(:disabled) {
  background: #14532d;
}

.sfinder-advanced {
  margin-top: 0.85rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.75rem;
}

.sfinder-advanced summary {
  width: max-content;
  color: #123b69;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.sfinder-assets {
  display: grid;
  grid-template-columns: repeat(7, minmax(8rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.sfinder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.sfinder-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0;
}

.sfinder-metric {
  min-height: 4.25rem;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 0.75rem 0.85rem;
}

.sfinder-metric span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sfinder-metric strong {
  display: block;
  margin-top: 0.28rem;
  color: #172033;
  font-size: 1.55rem;
  line-height: 1.15;
}

.sfinder-layout {
  display: block;
}

.sfinder-results {
  display: grid;
  gap: 0.6rem;
  min-height: 19rem;
  max-height: 58rem;
  overflow: auto;
  padding: 0.85rem;
}

.sfinder-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  border: 1px solid #d5dbe5;
  border-radius: 8px;
  padding: 0.8rem;
  background: #ffffff;
}

.sfinder-result:hover {
  border-color: #2f6aa3;
  background: #f4f8fc;
}

.sfinder-result__sentence {
  margin: 0;
  color: #172033;
  font-size: 1rem;
  line-height: 1.35;
}

.sfinder-result__id {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.sfinder-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.sfinder-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.73rem;
  font-weight: 800;
  padding: 0.16rem 0.45rem;
  white-space: nowrap;
}

.sfinder-badge--yes {
  border-color: #86c5a4;
  background: #ecfdf5;
  color: #14532d;
}

.sfinder-badge--no {
  border-color: #f2b8b5;
  background: #fff1f2;
  color: #9f1239;
}

.sfinder-badge--warn {
  border-color: #f3cf72;
  background: #fffbeb;
  color: #854d0e;
}

.sfinder-badge--button {
  font-family: inherit;
  cursor: pointer;
}

.sfinder-badge--button:disabled {
  cursor: not-allowed;
}

.sfinder-result__score {
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.35rem;
  min-width: 6.4rem;
}

.sfinder-score {
  min-width: 4.4rem;
  border-radius: 8px;
  background: #123b69;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
  padding: 0.35rem 0.5rem;
}

.sfinder-empty {
  margin: 0;
  color: #64748b;
  font-weight: 700;
}

.sfinder-parse-modal {
  position: fixed;
  z-index: 1001;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 2.5vh 2vw;
}

.sfinder-parse-modal[hidden] {
  display: none;
}

.sfinder-parse-modal__panel {
  width: min(96vw, 1680px);
  height: min(94vh, 980px);
  border: 1px solid #b9c4d2;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.sfinder-parse-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d5dbe5;
  background: #f8fafc;
  padding: 0.85rem 1rem;
}

.sfinder-parse-modal__title-block {
  min-width: 0;
}

.sfinder-parse-modal__head h2 {
  margin: 0;
  color: #172033;
  font-size: 1rem;
}

.sfinder-parse-modal__head code {
  display: block;
  margin-top: 0.25rem;
  color: #64748b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.sfinder-parse-modal__head p {
  margin: 0.25rem 0 0;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.35;
}

.sfinder-parse-modal__body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.85rem;
  min-height: 0;
  overflow: auto;
  padding: 0.85rem;
}

.sfinder-parse-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  gap: 0.35rem;
}

.sfinder-parse-field > span {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sfinder-parse-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  min-height: 0;
}

.sfinder-parse-box {
  width: 100%;
  box-sizing: border-box;
  user-select: text;
}

.sfinder-parse-box.manager-highlight {
  position: static;
  inset: auto;
  min-height: 28rem;
  max-height: 52vh;
  overflow: auto;
  pointer-events: auto;
}

.sfinder-parse-field--full .manager-conllu-editor {
  min-height: 13rem;
  max-height: 30vh;
}

.sfinder-parse-box .conllu-editor-cell,
.sfinder-parse-box .conllu-editor-line {
  user-select: text;
}

@media (max-width: 1180px) {
  .sfinder-grid--primary,
  .sfinder-grid--advanced,
  .sfinder-assets,
  .sfinder-layout {
    grid-template-columns: 1fr 1fr;
  }

  .sfinder-multiselect--wide {
    grid-column: span 2;
  }

  .sfinder-grid--primary .sfinder-btn--primary {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .sfinder-parse-grid {
    grid-template-columns: 1fr;
  }

  .sfinder-parse-box.manager-highlight {
    min-height: 20rem;
    max-height: 38vh;
  }
}

@media (max-width: 760px) {
  .sfinder {
    padding: 0.75rem 0.75rem 2rem;
  }

  .sfinder__header,
  .sfinder-result {
    display: block;
  }

  .sfinder__status {
    text-align: left;
  }

  .sfinder-grid--primary,
  .sfinder-grid--advanced,
  .sfinder-assets,
  .sfinder-metrics,
  .sfinder-layout,
  .sfinder-parse-grid {
    grid-template-columns: 1fr;
  }

  .sfinder-multiselect--wide {
    grid-column: auto;
  }

  .sfinder-grid--primary .sfinder-btn--primary {
    grid-column: auto;
  }

  .sfinder-result__score {
    justify-items: start;
    margin-top: 0.65rem;
  }

  .sfinder-parse-modal {
    padding: 1vh 1vw;
  }

  .sfinder-parse-modal__panel {
    width: 98vw;
    height: 98vh;
  }
}
