/* Стили для аннотаций домашних работ */
.ai-review-panel { padding:12px; border:1px solid #dbe3ee; border-radius:8px; background:#f7f9fc; }
.ai-review-list { max-height:24rem; overflow:auto; margin-top:.6rem; }
.ai-review-list:empty { margin:0; }
.ai-review-card { padding:.65rem; border-top:1px solid #dbe3ee; overflow-wrap:anywhere; background:#fff; }
.ai-review-card summary { cursor:pointer; font-weight:600; }
.ai-review-card blockquote { margin:.5rem 0; padding-left:.6rem; border-left:3px solid #cbd5e1; white-space:pre-wrap; }
.ai-suggestion { cursor:pointer; background:transparent; border-bottom:2px dashed; }
.ai-suggestion-language { border-color:var(--ann-language); }
.ai-suggestion-organisation { border-color:var(--ann-organisation); }
.ai-suggestion-good { border-color:var(--ann-good); }
.ai-suggestion:focus { outline:2px solid #345b8a; outline-offset:2px; }
/* Используется в кабинете преподавателя и студента */

:root {
  --ann-content: #2760a9;
  --ann-content-bg: #dceafe;
  --ann-ca: #24754b;
  --ann-ca-bg: #d9f4e5;
  --ann-organisation: #8050a2;
  --ann-organisation-bg: #f0e4ff;
  --ann-language: #876115;
  --ann-language-bg: #fff0c9;
  --ann-comment: #5b6abf;
  --ann-comment-bg: rgba(91, 106, 191, 0.18);
  --ann-good: #98c04f;
  --ann-good-bg: rgba(152, 192, 79, 0.22);
  --ann-ink-on-light: #1f2a10;
}

/* [WW] - Wrong Word - неправильное слово */
.annotation-ww {
  position: relative;
  display: inline;
  background-color: #fee;
  cursor: pointer;
}
.annotation-ww-text {
  color: #dc3545 !important;
  text-decoration: line-through !important;
}
.annotation-ww::after {
  content: attr(data-correct);
  display: inline;
  color: #28a745;
  text-decoration: none !important;
  margin-left: 5px;
  font-weight: bold;
  background-color: transparent;
}

/* [P] - Punctuation - пунктуация */
.annotation-p {
  position: relative;
  display: inline;
  background-color: #fee;
  cursor: pointer;
}
.annotation-p-text {
  color: #dc3545 !important;
  text-decoration: line-through !important;
}
.annotation-p::after {
  content: attr(data-correct);
  display: inline;
  color: #28a745;
  text-decoration: none !important;
  margin-left: 2px;
  font-weight: bold;
  background-color: transparent;
}

.annotation-content,
.annotation-ca,
.annotation-organisation,
.annotation-language,
.annotation-comment,
.annotation-good {
  position: relative;
  display: inline;
  cursor: pointer;
  padding: 1px 0;
  border-bottom: 2px solid;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.annotation-content {
  border-bottom-color: var(--ann-content);
  background-color: var(--ann-content-bg);
}

.annotation-ca {
  border-bottom-color: var(--ann-ca);
  background-color: var(--ann-ca-bg);
}

.annotation-organisation {
  border-bottom-color: var(--ann-organisation);
  background-color: var(--ann-organisation-bg);
}

.annotation-language {
  border-bottom-color: var(--ann-language);
  background-color: var(--ann-language-bg);
}

.annotation-comment {
  border-bottom-color: var(--ann-comment);
  background-color: var(--ann-comment-bg);
}

.annotation-good {
  border-bottom-color: var(--ann-good);
  background-color: var(--ann-good-bg);
}

/* Встроенный комментарий в тексте */
.annotation-comment-inline {
  font-style: italic;
  color: #6c757d;
  position: relative;
  cursor: help;
  display: inline;
}
.annotation-comment-inline:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: normal;
  max-width: 300px;
  text-align: left;
  z-index: 1000;
  font-size: 12px;
  margin-bottom: 5px;
  pointer-events: none;
  font-style: normal;
  word-wrap: break-word;
}

/* Tooltip для аннотаций при наведении */
.annotation-ww:hover::before,
.annotation-p:hover::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10000;
  font-size: 12px;
  pointer-events: none;
  font-style: normal;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.annotation-content:hover::before,
.annotation-ca:hover::before,
.annotation-organisation:hover::before,
.annotation-language:hover::before,
.annotation-comment:hover::before,
.annotation-good:hover::before {
  display: none;
}

.annotation-content:hover::after,
.annotation-ca:hover::after,
.annotation-organisation:hover::after,
.annotation-language:hover::after,
.annotation-comment:hover::after,
.annotation-good:hover::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid;
  z-index: 10001;
  pointer-events: none;
}

.annotation-content:hover::after { border-top-color: var(--ann-content); }
.annotation-ca:hover::after { border-top-color: var(--ann-ca); }
.annotation-organisation:hover::after { border-top-color: var(--ann-organisation); }
.annotation-language:hover::after { border-top-color: var(--ann-language); }
.annotation-comment:hover::after { border-top-color: var(--ann-comment); }
.annotation-good:hover::after { border-top-color: var(--ann-good); }

#annotation-tooltip {
  position: fixed;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 1rem;
  border: 1px solid #aab8c8;
  border-radius: 10px;
  background: #fff;
  color: #233044;
  text-align: left;
  z-index: 100000;
  font: 400 .94rem/1.6 system-ui, sans-serif;
  pointer-events: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 8px 32px #05296226;
}

.annotation-tooltip-title {
  display: block;
  margin-bottom: .3rem;
  font-weight: 700;
}

[data-annotation-id]:focus-visible {
  outline: 2px solid #052962;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Стили для редактора аннотаций (только для преподавателя) */
#annotation-editor:focus {
  outline: 2px solid #052962;
  outline-offset: 2px;
}

/* Панель инструментов для редактора */
.annotation-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.annotation-toolbar .btn.annotation-btn[data-type] {
  --bs-btn-bg: #fff;
  --bs-btn-hover-bg: var(--bs-btn-border-color);
  background-color: #fff;
  border-width: 1px;
  border-style: solid;
}

.annotation-toolbar .btn.annotation-btn[data-type="Content"] {
  --bs-btn-color: var(--ann-content);
  --bs-btn-border-color: var(--ann-content);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ann-content);
  --bs-btn-hover-border-color: var(--ann-content);
  color: var(--ann-content) !important;
  border-color: var(--ann-content) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="Content"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="Content"]:focus-visible {
  background-color: var(--ann-content) !important;
  border-color: var(--ann-content) !important;
  color: #fff !important;
}

.annotation-toolbar .btn.annotation-btn[data-type="CA"] {
  --bs-btn-color: var(--ann-ca);
  --bs-btn-border-color: var(--ann-ca);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ann-ca);
  --bs-btn-hover-border-color: var(--ann-ca);
  color: var(--ann-ca) !important;
  border-color: var(--ann-ca) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="CA"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="CA"]:focus-visible {
  background-color: var(--ann-ca) !important;
  border-color: var(--ann-ca) !important;
  color: #fff !important;
}

.annotation-toolbar .btn.annotation-btn[data-type="Organisation"] {
  --bs-btn-color: var(--ann-organisation);
  --bs-btn-border-color: var(--ann-organisation);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ann-organisation);
  --bs-btn-hover-border-color: var(--ann-organisation);
  color: var(--ann-organisation) !important;
  border-color: var(--ann-organisation) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="Organisation"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="Organisation"]:focus-visible {
  background-color: var(--ann-organisation) !important;
  border-color: var(--ann-organisation) !important;
  color: #fff !important;
}

.annotation-toolbar .btn.annotation-btn[data-type="Language"] {
  --bs-btn-color: var(--ann-language);
  --bs-btn-border-color: var(--ann-language);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ann-language);
  --bs-btn-hover-border-color: var(--ann-language);
  color: var(--ann-language) !important;
  border-color: var(--ann-language) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="Language"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="Language"]:focus-visible {
  background-color: var(--ann-language) !important;
  border-color: var(--ann-language) !important;
  color: #fff !important;
}

.annotation-toolbar .btn.annotation-btn[data-type="Comment"] {
  --bs-btn-color: var(--ann-comment);
  --bs-btn-border-color: var(--ann-comment);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--ann-comment);
  --bs-btn-hover-border-color: var(--ann-comment);
  color: var(--ann-comment) !important;
  border-color: var(--ann-comment) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="Comment"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="Comment"]:focus-visible {
  background-color: var(--ann-comment) !important;
  border-color: var(--ann-comment) !important;
  color: #fff !important;
}

.annotation-toolbar .btn.annotation-btn[data-type="Good"] {
  --bs-btn-color: var(--ann-good);
  --bs-btn-border-color: var(--ann-good);
  --bs-btn-hover-color: var(--ann-ink-on-light);
  --bs-btn-hover-bg: var(--ann-good);
  --bs-btn-hover-border-color: var(--ann-good);
  color: var(--ann-good) !important;
  border-color: var(--ann-good) !important;
}
.annotation-toolbar .btn.annotation-btn[data-type="Good"]:hover,
.annotation-toolbar .btn.annotation-btn[data-type="Good"]:focus-visible {
  background-color: var(--ann-good) !important;
  border-color: var(--ann-good) !important;
  color: var(--ann-ink-on-light) !important;
}

.annotation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  align-items: center;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.8rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #334155;
}

.annotation-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.annotation-legend-swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.annotation-legend-item[data-type="Content"] .annotation-legend-swatch {
  background: var(--ann-content-bg);
  border-color: var(--ann-content);
}
.annotation-legend-item[data-type="CA"] .annotation-legend-swatch {
  background: var(--ann-ca-bg);
  border-color: var(--ann-ca);
}
.annotation-legend-item[data-type="Organisation"] .annotation-legend-swatch {
  background: var(--ann-organisation-bg);
  border-color: var(--ann-organisation);
}
.annotation-legend-item[data-type="Language"] .annotation-legend-swatch {
  background: var(--ann-language-bg);
  border-color: var(--ann-language);
}
.annotation-legend-item[data-type="Comment"] .annotation-legend-swatch {
  background: var(--ann-comment);
  border-color: var(--ann-comment);
}
.annotation-legend-item[data-type="Good"] .annotation-legend-swatch {
  background: var(--ann-good);
  border-color: var(--ann-good);
}

.article-annotated [data-annotation-id]{border-bottom-style:solid;border-bottom-width:2px;box-decoration-break:clone;-webkit-box-decoration-break:clone;padding:1px 0;cursor:pointer}
.article-annotated [data-annotation-id]:focus-visible,.article-annotated [data-annotation-id].annotation-active{outline:2px solid #052962;outline-offset:3px;border-radius:2px}
.article-annotated .annotation-hidden{background:transparent;border-color:transparent;cursor:text}
.article-annotation-legend{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0 1.5rem}
.article-annotation-legend strong{flex-basis:100%;font-size:1rem}
.article-annotation-legend button{border:1px solid #8793a4;border-radius:2rem;padding:.35rem .7rem;color:#233044;font:inherit;font-size:.83rem;cursor:pointer}
.article-annotation-legend button[aria-pressed=false]{background:#fff!important;text-decoration:line-through}
.article-annotation-legend [data-type=Content],.criterion-content{background:#dceafe}
.article-annotation-legend [data-type=CA],.criterion-ca{background:#d9f4e5}
.article-annotation-legend [data-type=Organisation],.criterion-organisation{background:#f0e4ff}
.article-annotation-legend [data-type=Language],.criterion-language{background:#fff0c9}
#annotation-tooltip.article-tooltip{position:fixed;box-sizing:border-box;max-width:calc(100vw - 24px);width:360px!important;max-height:calc(100vh - 24px);overflow:auto;background:#fff;color:#233044;border:1px solid #aab8c8;border-radius:10px;padding:1rem;box-shadow:0 8px 32px #05296226;font:400 .94rem/1.6 system-ui,sans-serif;z-index:10000;pointer-events:auto;white-space:normal}
#annotation-tooltip.article-tooltip>div{white-space:pre-line}
#annotation-tooltip .article-tooltip-section+ .article-tooltip-section{margin-top:.8rem;padding-top:.8rem;border-top:1px solid #d7e3ef}
.article-content h2{font-size:1.7rem;margin:2.5rem 0 1.2rem;color:var(--brand-dark-blue,#052962)}
.article-content h3{font-size:1.18rem;margin:0 0 1rem;color:var(--brand-dark-blue,#052962)}
.article-content ol{padding-left:1.6rem}.article-content li{padding-left:.4rem;margin-bottom:1rem}
.article-source-texts{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1.5rem 0}
.article-source-texts>div,.article-feedback>div{padding:1.3rem;border:1px solid #d7e3ef;border-radius:12px;background:#fff}
.article-source-texts p{font-size:.97rem!important}.article-sample-answer{border-left:3px solid #5a9bc0;padding:0 0 0 1.25rem;margin:1.5rem 0}
.article-feedback{display:grid;gap:1rem}.article-feedback h3{display:inline-block;padding:.3rem .55rem;border-radius:6px}
@media(max-width:640px){.article-source-texts{grid-template-columns:1fr}.article-source-texts>div,.article-feedback>div{padding:1rem}.article-sample-answer{padding-left:.8rem}}

