/* Поверх apps-ds: только раскладка брифа, цвета и размеры — токенами */
body{margin:0;background:var(--dc-color-gray-300);color:var(--dc-color-gray-080)}
b{font-weight:500}
[hidden]{display:none !important}
.sprite{position:absolute;width:0;height:0;overflow:hidden}

/* Шапка */
.top{position:sticky;top:0;z-index:50;background:var(--dc-color-white-100);border-bottom:1px solid var(--dc-color-gray-300)}
.top__in{display:flex;align-items:center;gap:16px;max-width:1000px;margin:0 auto;padding:10px 16px;flex-wrap:wrap}
.top__title{font-weight:500;white-space:nowrap}
.top__progress{display:flex;align-items:center;gap:8px;flex:1;min-width:190px}
.top__progress .ds-progress{flex:1;max-width:180px}
.top__count{white-space:nowrap;color:var(--dc-color-gray-060)}
.top__status{font-size:var(--font-size-12);line-height:var(--line-height-16);color:var(--dc-color-gray-060);white-space:nowrap}
.top__status_error{color:var(--dc-color-red-100)}

/* Страница */
.page{max-width:1000px;margin:0 auto;padding:16px 16px 48px;box-sizing:border-box}
.intro{margin-bottom:16px}
.intro__title{margin:0}
.intro__sub{margin:4px 0 16px}
.intro__name{margin-top:20px;max-width:420px}
.intro__name .ds-field-label{margin-bottom:6px;flex-wrap:wrap;gap:0 12px}
.section{margin-top:32px}
.section__title{margin:0 0 16px}

/* Вопрос */
.q{margin-bottom:16px;gap:0}
.intro,.history-box{gap:0}
.q__comment-open{align-self:flex-start;margin:12px 0 0 -12px}
.q__head{display:flex;align-items:flex-start;gap:12px}
.q__no{flex:none;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:50%;background:var(--dc-color-purple-020);color:var(--dc-color-purple-100);font-weight:500}
.q__title{flex:1;margin:2px 0 0;min-width:0}
.q__head .ds-tag{flex:none;margin-top:2px}
.q__lead{margin:12px 0 0;padding:0 0 0 18px;list-style:disc}
.q__lead li{margin-top:6px}
.q__lead li:first-child{margin-top:0}
.q__facts{margin-top:16px}
.q__facts-title{font-weight:500;margin-bottom:8px}
.q__note{margin:8px 0 0}
.q__options{display:flex;flex-direction:column;gap:4px;margin-top:16px}
.q__options_grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.q__other{margin:4px 0 4px 34px}
.q__field{margin-top:16px}
.q__field .ds-field-label{margin-bottom:6px}
.q__table{margin-top:16px}
.q__add{margin-top:12px}
.q__conflict{margin-top:12px;border-radius:12px;padding:0 16px;flex-wrap:wrap}
.q__status:empty{display:none}
.q__status{margin-top:12px;font-size:var(--font-size-12);line-height:var(--line-height-16);color:var(--dc-color-gray-060)}
.q__status_error{color:var(--dc-color-red-100)}
.q__copy{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:10px;padding:10px 16px;border-radius:12px;background:var(--dc-color-gray-200)}
.q__copy-text{word-break:break-all;flex:1;min-width:200px}

/* Вариант ответа */
.opt{display:flex;align-items:flex-start;gap:12px;padding:10px 12px;border-radius:12px;cursor:pointer}
.opt:hover{background:var(--dc-color-gray-200)}
.opt:has(.ds-check__input:checked){background:var(--dc-color-purple-010)}
.opt__mark{flex:none;margin-top:3px}
.opt__text{display:flex;flex-direction:column;gap:2px;min-width:0}
.opt__rec{margin-left:8px;vertical-align:1px;white-space:nowrap}
.opt__hint{display:block}

/* Таблицы */
.t-wrap{overflow-x:auto;border-radius:12px;border:1px solid var(--dc-color-gray-300)}
.t th:last-child,.t td:last-child{border-right:0}
.t{width:100%;border-collapse:separate;border-spacing:0}
.t th,.t td,.t th:first-child,.t td:first-child{text-align:left;padding:8px 12px;height:auto;vertical-align:middle}
.t thead th{position:static;white-space:normal;min-width:90px;background:var(--dc-color-gray-200)}
.t td.t__locked{min-width:160px}
.t td.t__edit{min-width:120px}
.t .ds-input{min-width:96px}
.t th.t__tool,.t td.t__tool{width:32px;min-width:32px;padding-left:4px;padding-right:4px;text-align:center}
.t_facts td:not(:first-child),.t_facts th:not(:first-child){white-space:nowrap}
.cell-select{width:100%;min-width:112px;justify-content:space-between}
.cell-select .ds-btn__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.popup-fixed{position:fixed;z-index:1000;max-height:320px;overflow:auto}

/* История */
.history-box{margin-top:32px}
.history-box__title{cursor:pointer;font-weight:500}
.history{list-style:none;margin:12px 0 0;padding:0}
.history__row{display:flex;gap:12px;padding:6px 0;border-top:1px solid var(--dc-color-gray-300)}
.history__time{flex:none;width:130px}

/* Вход */
.login-page{display:flex;align-items:center;justify-content:center;min-height:100vh;padding:16px;box-sizing:border-box}
.login{width:100%;max-width:400px;box-sizing:border-box;background:var(--dc-color-white-100);border-radius:20px;padding:28px}
.login__title{margin:0;font-size:var(--font-size-24);line-height:var(--line-height-32);font-weight:500}
.login__sub{margin:4px 0 24px}
.login .ds-field-label{margin-bottom:6px}
.login__field{display:flex;margin-bottom:16px}
.login__error{margin:0 0 12px;color:var(--dc-color-red-100)}
.login__submit{width:100%;justify-content:center}

/* Телефон */
@media (max-width:640px){
  .ds-widget{--pad-h:var(--space-20);--pad-v:var(--space-20)}
  .top__in{gap:8px 12px}
  .top__title{display:none}
  .top__progress{flex-basis:100%}
  .top__seg{order:2}
  .q__head{flex-wrap:wrap}
  .q__title{flex-basis:calc(100% - 40px)}
  .q__head .ds-tag{margin-left:40px;margin-top:0}
  .q__options_grid{grid-template-columns:1fr}
  .q__other{margin-left:0}
  .history__row{flex-direction:column;gap:0}
}
