/* MangaNew — звернення (/response/*.html, engine/modules/mgticket/page.php) */
.mgt { --mgt-open: var(--warn); --mgt-ans: var(--ok); --mgt-closed: var(--muted); }
.mgt-i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Шапка */
.mgt-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.mgt-hero .sec-title { margin: 0 0 8px; }
.mgt-hero__lead { max-width: 60ch; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.mgt-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.mgt-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px; border-radius: var(--radius-btn); border: 2px solid var(--line-strong); color: var(--text); font-size: 14px; font-weight: 600; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.mgt-tabs a:hover { border-color: var(--frame); color: var(--text); }
.mgt-tabs a.is-active { background: var(--frame); border-color: var(--frame); color: var(--bg); }
.mgt-tabs .mgt-i { width: 16px; height: 16px; }
.mgt-tabs small { padding: 0 7px; border-radius: var(--radius-btn); background: var(--line); font-size: 12px; line-height: 20px; }

/* Повідомлення */
.mgt-alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 13px 16px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.mgt-alert--ok { background: color-mix(in srgb, var(--mgt-ans) 14%, transparent); color: var(--text); }
.mgt-alert--ok .mgt-i { color: var(--mgt-ans); margin-top: 1px; }
.mgt-alert--err { flex-direction: column; gap: 4px; background: color-mix(in srgb, var(--danger) 14%, transparent); }
.mgt-alert--err b { color: var(--danger); }
.mgt-alert ul { margin: 0; padding-left: 18px; }
.mgt-gate { padding: 36px 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.mgt-gate b { display: block; font-size: 18px; margin-bottom: 6px; }
.mgt-gate p { max-width: 52ch; margin: 0 auto 18px; color: var(--muted); }
.mgt-gate__btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

/* Розділи-картки */
.mgt-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mgt-cat { position: relative; display: block; color: inherit; cursor: pointer; }
.mgt-cat input { position: absolute; opacity: 0; pointer-events: none; }
.mgt-cat__box { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 12px; height: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.mgt-cat__ico { grid-row: 1 / 3; width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mgt-cat__box b { align-self: end; font-size: 15px; color: var(--text); }
.mgt-cat__box small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.mgt-cat:hover .mgt-cat__box { border-color: var(--frame-soft); }
.mgt-cat input:checked + .mgt-cat__box { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mgt-cat input:focus-visible + .mgt-cat__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.mgt-cats--links .mgt-cat:hover .mgt-cat__box { border-color: var(--accent); transform: translateY(-1px); }

/* Форма */
.mgt-form { display: flex; flex-direction: column; gap: 22px; }
.mgt-step { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.mgt-step legend { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.mgt-step legend span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.mgt-field textarea, .mgt-add textarea, .mgt-captcha input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; line-height: 1.55; resize: vertical; transition: border-color .15s ease; }
.mgt-field textarea:focus, .mgt-add textarea:focus, .mgt-captcha input:focus { outline: none; border-color: var(--accent); }
.mgt-field__foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.mgt-count { font-variant-numeric: tabular-nums; }
.mgt-count.is-near { color: var(--warn); }
.mgt-count.is-over { color: var(--danger); font-weight: 700; }
.mgt-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.mgt-row__label { color: var(--muted); font-size: 14px; }
.mgt-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.mgt-seg label { position: relative; cursor: pointer; }
.mgt-seg input { position: absolute; opacity: 0; }
.mgt-seg span { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.mgt-seg .mgt-i { width: 15px; height: 15px; }
.mgt-seg input:checked + span { background: var(--surface-2); color: var(--text); }
.mgt-seg input[value="2"]:checked + span { color: #f58a4b; }
.mgt-seg input:focus-visible + span { outline: 2px solid var(--accent); }
.mgt-drop { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--line-strong); color: var(--muted); cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.mgt-drop:hover, .mgt-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.mgt-drop.has-file { border-style: solid; border-color: var(--accent); color: var(--text); }
.mgt-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mgt-drop .mgt-i { width: 22px; height: 22px; color: var(--accent); }
.mgt-drop__text { display: flex; flex-direction: column; min-width: 0; }
.mgt-drop__text b { color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgt-drop__text small { font-size: 12px; }
.mgt-drop__x { position: relative; z-index: 1; margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 18px; cursor: pointer; }
.mgt-captcha input { max-width: 220px; }
.mgt-submit { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.mgt-submit .btn { min-height: 46px; padding: 0 26px; font-size: 15px; }
.mgt-submit .btn.is-busy { opacity: .7; pointer-events: none; }
.mgt-limit { color: var(--muted); font-size: 13px; }

/* Головна */
.mgt-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.mgt-main .sec-title--sm { margin: 0 0 12px; }
.mgt-main__mine { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.mgt-main__mine .sec-title--sm { margin: 4px 0 0; }
.mgt-main__mine .sec-link { align-self: flex-start; font-size: 14px; }
.mgt-main__mine .btn--block .mgt-i { width: 16px; height: 16px; }
.mgt-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mgt-sum a { display: flex; flex-direction: column; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.mgt-sum b { font-size: 24px; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.mgt-sum a:first-child b { color: var(--mgt-open); }
.mgt-sum a:last-child b { color: var(--mgt-ans); }
.mgt-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mgt-mini a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: inherit; }
.mgt-mini a:hover { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.mgt-mini .mgt-st { grid-column: 1 / -1; justify-self: start; }
.mgt-mini b { font-size: 14px; }
.mgt-mini small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgt-mini .mgt-card__new { grid-column: 2; grid-row: 2; }
.mgt-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; }

/* Стан */
.mgt-st { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.mgt-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mgt-st--open { background: color-mix(in srgb, var(--mgt-open) 16%, transparent); color: var(--mgt-open); }
.mgt-st--answered { background: color-mix(in srgb, var(--mgt-ans) 16%, transparent); color: var(--mgt-ans); }
.mgt-st--closed { background: var(--surface-2); color: var(--muted); }
.mgt-card__new { padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 16px; white-space: nowrap; }

/* Мої звернення */
.mgt-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mgt-filter a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 14px; font-weight: 600; }
.mgt-filter a:hover { color: var(--text); }
.mgt-filter a.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.mgt-filter small { opacity: .7; }
.mgt-list { display: flex; flex-direction: column; gap: 10px; }
.mgt-card { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); scroll-margin-top: 90px; }
.mgt-card:target, .mgt-card.is-focus { border-color: var(--accent); }
.mgt-card details > summary { list-style: none; }
.mgt-card details > summary::-webkit-details-marker { display: none; }
.mgt-card__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.mgt-card__title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.mgt-card__title b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgt-card__title small { color: var(--muted); font-size: 12px; }
.mgt-hot { color: #f58a4b; font-style: normal; font-weight: 600; }
.mgt-card__n:empty { display: none; }
.mgt-card__n { min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; line-height: 22px; text-align: center; }
.mgt-card__chev { width: 9px; height: 9px; margin: 0 4px 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s ease; }
.mgt-card details[open] .mgt-card__chev { transform: translateY(3px) rotate(-135deg); }
.mgt-thread { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.mgt-msg { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.mgt-msg--team { margin-left: 28px; background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); border-left: 3px solid var(--accent); }
.mgt-msg__who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.mgt-msg--team .mgt-msg__who { color: var(--accent); }
.mgt-msg__who .mgt-i { width: 14px; height: 14px; }
.mgt-msg__who time { margin-left: auto; color: var(--muted); font-weight: 500; }
.mgt-msg__text a { color: var(--accent); word-break: break-all; }
.mgt-msg__text img { max-width: 100%; height: auto; border-radius: 8px; }
.mgt-msg__text b[data-mgt-add] { display: inline-block; margin-top: 4px; color: var(--accent); font-size: 12px; }
.mgt-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 5px 10px; border-radius: 8px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; }
.mgt-file .mgt-i { width: 15px; height: 15px; }
.mgt-wait { margin: 0; color: var(--muted); font-size: 13px; }
.mgt-actions { display: flex; justify-content: flex-end; }
.mgt-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.mgt-link:hover { background: var(--accent-soft); }
.mgt-link .mgt-i { width: 16px; height: 16px; }
.mgt-add { display: flex; flex-direction: column; gap: 8px; }
.mgt-add[hidden] { display: none; }
.mgt-add__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.mgt-add__foot .mgt-count { margin-right: auto; color: var(--muted); font-size: 12px; }

@media (max-width: 860px) {
  .mgt-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .mgt-cats { grid-template-columns: minmax(0, 1fr); }
  .mgt-hero { margin-bottom: 16px; }
  .mgt-tabs { width: 100%; }
  .mgt-tabs a { flex: 1; justify-content: center; padding: 0 8px; font-size: 13px; }
  .mgt-card__head { flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; }
  .mgt-card__title { order: 3; flex-basis: 100%; }
  .mgt-msg--team { margin-left: 12px; }
  .mgt-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .mgt-filter a { flex: none; }
}

/* пропозиція правки зі сторінки тайтлу (?news=ID) */
.mgt-about { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mgt-about__k { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mgt-about__v { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--text); }
.mgt-about__v:hover { color: var(--accent); }
.mgt-about small { color: var(--muted); font-size: 13px; }

/* «Доповнити / Відповісти» — <details> (працює й без JavaScript) */
.mgt-addbox { margin-top: 4px; }
.mgt-addbox > summary { list-style: none; width: max-content; }
.mgt-addbox > summary::-webkit-details-marker { display: none; }
.mgt-addbox[open] > summary { margin-bottom: 8px; color: var(--muted); }
