/* Члены предложения — подчёркивания школьного стиля */

.sent-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.15rem 0.35rem;
  font-size: 1.45rem;
  line-height: 1.85;
  padding: 0.5rem 0.25rem 0.75rem;
  user-select: none;
}

/* Подсказка под предложением: фиксированная зона, чтобы вёрстка не прыгала */
.sent-step-hint {
  min-height: 2.75em;
  margin: 0 0 0.75rem;
  padding: 0.15rem 0.25rem 0;
  line-height: 1.35;
  color: #4a5a68;
}

.sent-token {
  position: relative;
  display: inline-block;
  padding: 0.1em 0.12em 0.4em;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: default;
  border-radius: 3px;
}

.sent-token--word {
  cursor: pointer;
}

.sent-token--word:disabled,
.sent-token--idle {
  cursor: default;
  opacity: 1;
  color: inherit;
}

.sent-token--word:disabled:hover::before,
.sent-token--word:disabled:focus::after,
.sent-token--word:disabled:focus-visible::after,
.sent-token--idle:hover::before,
.sent-token--idle:focus::after,
.sent-token--idle:focus-visible::after {
  content: none;
  display: none;
}

/* Подсветка через ::before — не затирает background-image подчёркивания */
.sent-token--word:hover:not(:disabled)::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0.36em;
  background: rgba(30, 90, 140, 0.1);
  border-radius: 3px 3px 0 0;
  pointer-events: none;
  z-index: 0;
}

.sent-token--word > * {
  position: relative;
  z-index: 1;
}

/* Рамка выбора не заходит на зону подчёркивания снизу */
.sent-token--word:focus,
.sent-token--word:focus-visible {
  outline: none;
}

.sent-token--word:focus::after,
.sent-token--word:focus-visible::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0.32em;
  border: 1.5px solid #2a6f97;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  pointer-events: none;
  z-index: 1;
}

.sent-token--punct {
  cursor: default;
}

.sent-token--from::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0.36em;
  background: rgba(42, 111, 151, 0.14);
  border-radius: 3px 3px 0 0;
  pointer-events: none;
  z-index: 0;
}

.sent-token--from-pick::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0.32em;
  border: 1.5px solid #b45309;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  pointer-events: none;
  z-index: 1;
}

.sent-token--locked {
  cursor: default;
}

.sent-token--locked:hover:not(:disabled)::before {
  display: none;
}

.sent-tool--from.is-active {
  border-color: #b45309;
  box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.25);
  background: #fff8f0;
}

/* Подчёркивания */
.sent-token--subject {
  box-shadow: inset 0 -2px 0 0 #1a1a1a;
}

.sent-token--predicate {
  box-shadow:
    inset 0 -2px 0 0 #1a1a1a,
    inset 0 -5px 0 0 #1a1a1a;
}

.sent-token--attribute {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 T20 3' fill='none' stroke='%231a1a1a' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 20px 6px;
}

.sent-token--object {
  box-shadow: inset 0 -2px 0 0 transparent;
  background-image: linear-gradient(
    to right,
    #1a1a1a 0 55%,
    transparent 55% 100%
  );
  background-size: 10px 2px;
  background-repeat: repeat-x;
  background-position: left bottom;
}

.sent-token--adverbial {
  background-image: linear-gradient(
    to right,
    #1a1a1a 0 40%,
    transparent 40% 55%,
    #1a1a1a 55% 62%,
    transparent 62% 100%
  );
  background-size: 16px 2px;
  background-repeat: repeat-x;
  background-position: left bottom;
}

.sent-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}

.sent-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 6.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c5d0da;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: #1a1a1a;
}

.sent-tool:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.sent-tool.is-active {
  border-color: #2a6f97;
  box-shadow: 0 0 0 2px rgba(42, 111, 151, 0.25);
}

.sent-tool--from {
  border-style: dashed;
  min-width: 5.5rem;
}

.sent-tool__sample {
  display: block;
  min-width: 2.4rem;
  padding-bottom: 0.3em;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sent-tool__sample--subject {
  box-shadow: inset 0 -2px 0 0 #1a1a1a;
}

.sent-tool__sample--predicate {
  box-shadow:
    inset 0 -2px 0 0 #1a1a1a,
    inset 0 -5px 0 0 #1a1a1a;
}

.sent-tool__sample--attribute {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='6' viewBox='0 0 20 6'%3E%3Cpath d='M0 3 Q5 0 10 3 T20 3' fill='none' stroke='%231a1a1a' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: left bottom;
  background-size: 20px 6px;
}

.sent-tool__sample--object {
  background-image: linear-gradient(to right, #1a1a1a 0 55%, transparent 55% 100%);
  background-size: 10px 2px;
  background-repeat: repeat-x;
  background-position: left bottom;
}

.sent-tool__sample--adverbial {
  background-image: linear-gradient(
    to right,
    #1a1a1a 0 40%,
    transparent 40% 55%,
    #1a1a1a 55% 62%,
    transparent 62% 100%
  );
  background-size: 16px 2px;
  background-repeat: repeat-x;
  background-position: left bottom;
}

.sent-tool__label {
  font-size: 0.85rem;
}

.sent-q-panel {
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #c5d0da;
  border-radius: 6px;
  background: #f7fafc;
}

.sent-links__title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sent-links__empty {
  margin: 0;
  font-size: 0.9rem;
  color: #5a6a78;
}

.sent-links__list {
  margin: 0;
  padding-left: 1.1rem;
}

.sent-links__item {
  margin: 0.25rem 0;
  line-height: 1.45;
}

.sent-links__role {
  color: #5a6a78;
}

.sent-links__del {
  margin-left: 0.4rem;
  border: none;
  background: transparent;
  color: #8a3a3a;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  vertical-align: middle;
}

.sent-link-editor {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px dashed #c5d0da;
}

.sent-link-editor__head {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.sent-link-editor__wait {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  color: #5a6a78;
}

.sent-link-preview {
  margin: 0 0 0.75rem;
  padding: 0.45rem 0.6rem;
  background: #fff;
  border: 1px solid #d5e0ea;
  border-radius: 4px;
  font-size: 1.05rem;
}

.sent-link-editor__step {
  margin: 0.55rem 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sent-link-editor__row {
  margin-bottom: 0.5rem;
}

.sent-link-editor__label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.sent-q-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sent-q-choice {
  padding: 0.35rem 0.65rem;
  border: 1px solid #c5d0da;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-style: italic;
  cursor: pointer;
}

.sent-q-choice:hover {
  border-color: #2a6f97;
  background: #eef5fa;
}

.sent-q-choice.is-active {
  border-color: #2a6f97;
  background: #e8f2f8;
  box-shadow: 0 0 0 2px rgba(42, 111, 151, 0.2);
}

.sent-token--to::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0.32em;
  border: 1.5px solid #2a6f97;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
  pointer-events: none;
  z-index: 1;
}

.sent-model {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #dde3ea;
}

.sent-model__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.sent-wrong-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
