/* Экраны кабинета арендатора в стиле «Бенто» (обе темы). Токены и общие компоненты — ../ui/zsp.css. */

/* ---------- Загрузка ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--primary); animation: spin 1s linear infinite; }
.boot-err { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; }
.boot-err .ic { width: 40px; height: 40px; color: var(--muted); }

/* ---------- Вход: две бенто-карточки ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.25fr minmax(380px, 1fr); gap: 16px; padding: 16px; background: var(--bg); }
.login-media { position: relative; overflow: hidden; min-height: 280px; color: #fff; border-radius: 30px; }
.login-media::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(0deg, rgba(10,14,22,.7), transparent 50%); pointer-events: none; }
.login-mark { position: absolute; z-index: 5; left: clamp(22px, 3vw, 44px); top: clamp(20px, 3vw, 40px); color: #fff; }
.login-mark .logo { width: 110px; height: 110px; filter: drop-shadow(0 4px 18px rgba(0,0,0,.4)); }
.login-slogan { position: absolute; left: clamp(20px, 4vw, 56px); right: clamp(20px, 4vw, 56px); bottom: clamp(24px, 5vw, 64px); z-index: 4; max-width: 640px; }
.login-slogan .eyebrow { color: rgba(255,255,255,.8); }
.login-slogan h2 { font-size: clamp(26px, 3.4vw, 46px); line-height: 1.08; text-wrap: balance; font-weight: 800; letter-spacing: -.03em; }
.login-panel { position: relative; display: grid; place-items: center; padding: 40px 24px; background: var(--surface); border-radius: 30px; }
[data-theme="dark"] .login-panel { background: #171a20; box-shadow: inset 0 0 0 1px #232831; }
.login-theme { position: absolute; top: 16px; right: 16px; }
.login-inner { width: min(400px, 100%); display: grid; gap: 18px; }
.login-inner .brand { margin-bottom: 10px; }
.login-inner h1 { font-size: 36px; }
.login-foot { font-size: 13.5px; border-top: 1px solid var(--border); padding-top: 16px; }
.login-tip { margin: -6px 0 0; font-size: 13px; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 44px; }
.pass-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.pw-rules { list-style: none; margin: -6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pw-rules li { display: flex; gap: 6px; align-items: center; }
.pw-rules .ic { width: 15px; height: 15px; opacity: .35; }
.pw-rules li.is-ok { color: var(--st-done); } .pw-rules li.is-ok .ic { opacity: 1; }
.done-box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.done-box > .ic { width: 26px; height: 26px; color: var(--primary); margin-top: 2px; }
.done-box b { display: block; margin-bottom: 4px; }
#resetBody { display: grid; gap: 18px; }

/* ---------- Главная: бенто-сетка ---------- */
.home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.home > * { min-width: 0; }
.home.no-att .hero { grid-column: 1 / -1; }
.hero { position: relative; grid-column: span 2; border-radius: var(--radius-lg); overflow: hidden; min-height: 420px; display: grid; align-items: end; gap: 24px; padding: clamp(20px, 3vw, 36px); color: #fff; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(0deg, rgba(10,14,22,.82), rgba(10,14,22,.05) 65%); }
.hero .eyebrow { color: rgba(255,255,255,.78); }
.hero h1 { font-size: clamp(28px, 4vw, 44px); }
.hero .lead { margin-top: 8px; font-size: 17px; opacity: .92; min-height: 1.5em; }
.hero .lead .skel { --skel: rgba(255,255,255,.18); --skel-hi: rgba(255,255,255,.3); }
.hero-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: #141821; }
[data-theme="dark"] .hero .btn-primary { background: #eceff4; color: #0e1014; }
.hero .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); backdrop-filter: blur(6px); }
.hero .btn-ghost:hover { background: rgba(255,255,255,.16); }
.hero-stats { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; margin: 0; }
.hero-stats .stat { display: grid; align-content: space-between; min-width: 104px; max-width: 170px; padding: 12px 14px; border-radius: 18px; color: #fff; background: rgba(255,255,255,.18); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.18); transition: background .2s, transform .2s; }
.hero-stats .stat:hover { background: rgba(255,255,255,.28); transform: translateY(-1px); }
[data-theme="dark"] .hero-stats .stat { background: rgba(14,16,20,.45); border-color: rgba(255,255,255,.14); }
[data-theme="dark"] .hero-stats .stat:hover { background: rgba(14,16,20,.62); }
.hero-stats span { font-size: 12.5px; line-height: 1.25; opacity: .85; hyphens: manual; }
.hero-stats b { margin-top: 2px; font: 700 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.hero-stats:empty { display: none; }

.attention { background: #141821; color: #fff; border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; }
[data-theme="dark"] .attention { background: linear-gradient(160deg, #1d2335, #171a20 60%); box-shadow: inset 0 0 0 1px #2a3144; }
.attention .sec-h { color: #fff; margin-bottom: 14px; }
.attention .skel { --skel: rgba(255,255,255,.06); --skel-hi: rgba(255,255,255,.12); }
.att-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; flex: 1; align-content: start; }
.att-card { background: rgba(255,255,255,.07); color: #fff; border-radius: 18px; padding: 16px; display: grid; gap: 8px; }
[data-theme="dark"] .att-card { background: rgba(255,255,255,.05); }
.att-card .muted, .att-top { color: #b4bccb; }
.att-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.att-card h3 { font-size: 16px; }
.att-link { display: grid; gap: 4px; color: inherit; text-decoration: none; border-radius: 8px; }
.att-link:hover h3 { text-decoration: underline; }
.att-card .chip { background: rgba(255,255,255,.12); color: #fff; }
.att-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.att-card .btn-ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.att-card .btn-ghost:hover { background: rgba(255,255,255,.08); }
.att-card .btn-primary { background: #fff; color: #141821; }
[data-theme="dark"] .att-card .btn-primary { background: var(--primary); color: var(--primary-ink); }
.att-more { color: #fff; }

.services, .recent { grid-column: 1 / -1; }
.services { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; }
[data-theme="dark"] .services { box-shadow: inset 0 0 0 1px #232831; }

/* плитки услуг */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; gap: 10px; }
.tile { position: relative; text-align: left; display: grid; grid-template-columns: 1fr; row-gap: 4px; align-content: start; min-height: 150px; padding: 16px; border-radius: 18px; background: var(--surface-2); transition: transform .2s, background .2s, box-shadow .2s; }
.tile:hover { transform: translateY(-2px); background: var(--bb, var(--surface-2)); }
.tile-ic { margin-bottom: 18px; }
.tile-name { font-weight: 600; font-size: 15px; line-height: 1.25; padding-right: 26px; }
.tile-desc { font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 3px; }
.tile-go { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--muted); transition: transform .2s; }
.tile-go .ic { width: 16px; height: 16px; }
.tile:hover .tile-go { transform: translateX(2px); }
/* две большие плитки: «Разовые пропуска» (внешний сервис, пунктир) и «Постоянные пропуска» (обводка) */
.tiles > .tile[data-block="pass"], .tiles > .tile-ext { grid-column: span 2; grid-row: span 2; background: var(--bb); }
.tiles > .tile[data-block="pass"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bf) 38%, transparent); }
.tiles > .tile-ext { border: 1.5px dashed color-mix(in srgb, var(--bf) 55%, transparent); background: color-mix(in srgb, var(--bb) 55%, transparent); }
.tiles > .tile[data-block="pass"] .tile-ic, .tiles > .tile-ext .tile-ic { width: 64px; height: 64px; border-radius: 20px; background: #fff; margin-bottom: auto; }
.tiles > .tile[data-block="pass"] .tile-ic .ic, .tiles > .tile-ext .tile-ic .ic { width: 32px; height: 32px; }
.tiles > .tile[data-block="pass"] .tile-name, .tiles > .tile-ext .tile-name { font-size: 22px; font-weight: 700; margin-top: 40px; }
.tiles > .tile[data-block="pass"] .tile-desc, .tiles > .tile-ext .tile-desc { font-size: 14.5px; }
[data-theme="dark"] .tile { background: #272c37; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
[data-theme="dark"] .tile:hover { background: color-mix(in srgb, var(--bf, #8ea6ff) 18%, #272c37); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bf, #8ea6ff) 45%, transparent); }
[data-theme="dark"] .tiles > .tile[data-block="pass"], [data-theme="dark"] .tiles > .tile-ext { background: color-mix(in srgb, var(--bf) 16%, #1f242d); }
[data-theme="dark"] .tiles > .tile[data-block="pass"] { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bf) 45%, transparent); }
[data-theme="dark"] .tiles > .tile-ext { box-shadow: none; }
[data-theme="dark"] .tile-go { background: rgba(255,255,255,.08); color: #eceff4; }
[data-theme="dark"] .tiles > .tile[data-block="pass"] .tile-ic, [data-theme="dark"] .tiles > .tile-ext .tile-ic { background: rgba(0,0,0,.3); }
/* каталог в шторке — все плитки одного размера */
.tiles-sheet { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.tiles-sheet .tile { min-height: 130px; }
.tiles-sheet .tile-ic { margin-bottom: 14px; }

/* ---------- Список заявок ---------- */
.tlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tlist-page { grid-template-columns: minmax(0, 1fr); }
.tlist .empty, .tlist .load-err { grid-column: 1 / -1; }
.trow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border-radius: 18px; transition: box-shadow .2s, transform .2s; }
.trow:hover { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--primary) 40%, transparent); }
[data-theme="dark"] .trow { background: #171a20; }
.trow-ic { width: 38px; height: 38px; border-radius: 12px; }
.trow-ic .ic { width: 20px; height: 20px; }
.trow-main { display: grid; min-width: 0; gap: 1px; }
.trow-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-sum { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-side { display: grid; justify-items: end; gap: 4px; }
.trow-due { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.trow-due .ic { width: 14px; height: 14px; }
.trow.is-skel { pointer-events: none; }
.tickets-bar { justify-content: space-between; }
.tickets-find { display: flex; gap: 8px; align-items: center; }
.page .toolbar .search { min-width: 280px; }
.sort-btn { white-space: nowrap; }
.sort-btn.is-old .ic { transform: scaleY(-1); }
.trow.is-skel .trow-main { gap: 8px; }

/* ---------- Карточка заявки ---------- */
.back { font-size: 14px; justify-self: start; }
.ticket-head { display: flex; gap: 16px; align-items: flex-start; }
.ticket-head > div { min-width: 0; }
.ticket-head h1 { overflow-wrap: anywhere; }
.ticket-no { display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; }
.copy-btn { --h: 28px; margin: -4px 0; }
.copy-btn .ic { width: 16px; height: 16px; }
.ticket-ic { width: 52px; height: 52px; border-radius: 16px; }
.ticket-ic .ic { width: 26px; height: 26px; }
.ticket-meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.ticket-meta > span:not(.chip):not(.tag) { display: inline-flex; gap: 5px; align-items: center; }
.ticket-meta .ic { width: 16px; height: 16px; }
.pause-note { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; padding: 6px 12px; border-radius: 999px; font-size: 13.5px;
  background: color-mix(in srgb, var(--st-pause) 14%, transparent); color: color-mix(in srgb, var(--st-pause) 75%, var(--text)); }
.pause-note .ic { width: 16px; height: 16px; }
.confirm-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; padding: 22px; border-radius: var(--radius); background: color-mix(in srgb, var(--st-wait) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-wait) 35%, transparent); }
.confirm-box h2 { font-size: 19px; margin-bottom: 6px; }
.confirm-box > div { display: grid; gap: 6px; }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.return-form { grid-column: 1 / -1; display: grid; gap: 10px; }
.result-card .chip { margin-bottom: 8px; }
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
/* Живое обновление (UI.md §1): обёртка верхних блоков карточки не влияет на сетку; новое и изменившееся — одна мягкая вспышка */
.tk-top { display: contents; }
.trow.is-fresh, .drow.is-fresh { animation: zsp-fresh 2.4s ease-out; }
.msg.is-new .msg-b { animation: zsp-ring 2.4s ease-out; }
@keyframes zsp-fresh { from { background-color: var(--primary-soft); } }
@keyframes zsp-ring { from { box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 4px var(--primary); } to { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .trow.is-fresh, .drow.is-fresh, .msg.is-new .msg-b { animation: none; } }
/* «Ход заявки» — на лёгкой подложке цвета портала, со значком в заголовке */
.card-h-ic { display: flex; align-items: center; gap: 10px; }
.h-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--hc) 14%, transparent); color: var(--hc); }
.h-ic .ic { width: 18px; height: 18px; }
.card-timeline { --hc: var(--primary); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.card-facts { grid-column: 1 / -1; }
/* «Детали» (UI.md §5.1): текст арендатора крупно, короткие поля плашками (дата первой), списки таблицей, контакт строкой */
.dt { display: grid; gap: 16px; }
.dt-l { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.dt-texts { display: grid; gap: 12px; }
.dt-ask p { max-width: 75ch; font-size: 15px; line-height: 1.5; }
.dt-ask.is-lead p { font-size: 17px; font-weight: 500; }
.dt-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; max-width: 100%; min-width: 0; padding: 7px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.pill small { font-size: 12.5px; color: var(--muted); }
.pill b { font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pill-date { background: var(--primary-soft); }
.pill-date em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--primary); }
.dt-tbl { overflow-x: auto; }
.dt-tbl table { border-collapse: collapse; font-size: 14px; }
.dt-tbl th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 14px 6px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.dt-tbl td { padding: 7px 14px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.dt-tbl tr:last-child td { border-bottom: 0; }
.dt-tbl td.num { width: 1%; color: var(--muted); }
.dt-people { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); container-type: inline-size; }
.dt-person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.dt-who { display: grid; line-height: 1.3; min-width: 0; }
.dt-who small { font-size: 12.5px; color: var(--muted); }
.dt-reach { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; align-items: center; min-width: 0; }
.dt-reach .icon-btn { width: 32px; height: 32px; margin-left: -10px; }
.dt-reach .icon-btn .ic, .dt-reach .link .ic { width: 16px; height: 16px; }
.dt-mail { min-width: 0; } .dt-mail span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* узкая карточка (панель справа): телефон и e-mail — под именем, в столбик, длинный адрес переносится */
@container (max-width: 720px) {
  .dt-person { grid-template-columns: auto minmax(0, 1fr); }
  .dt-reach { grid-column: 2; justify-content: flex-start; }
  .dt-mail { flex-basis: 100%; }
  .dt-mail span { white-space: normal; overflow-wrap: anywhere; }
}
.dt-files .att-imgs { margin-top: 4px; }
.card-h-sub { font-size: 14.5px; margin: 18px 0 10px; }
.chat { display: grid; gap: 10px; margin-bottom: 14px; max-height: 520px; overflow: auto; padding-right: 2px; }
.msg { max-width: 88%; display: grid; gap: 3px; justify-self: start; }
.msg-b { padding: 10px 13px; border-radius: 14px; background: var(--surface-2); font-size: 14.5px; overflow-wrap: anywhere; }
.msg small { font-size: 11.5px; color: var(--muted); padding: 0 4px; }
.msg-me { justify-self: end; } .msg-me small { text-align: right; }
.msg-me .msg-b { background: var(--primary-soft); }
[data-theme="dark"] .msg-b { background: #22262e; } [data-theme="dark"] .msg-me .msg-b { background: rgba(142,166,255,.15); }
/* Картинки в сообщении — как в мессенджере: одна — целиком, несколько — плиткой */
.msg-pics { display: grid; gap: 4px; margin-top: 8px; }
.msg-pics a { display: block; border-radius: 10px; overflow: hidden; line-height: 0; background: color-mix(in srgb, var(--muted) 12%, transparent); cursor: zoom-in; }
.msg-pics { justify-items: start; }
.msg-pics img { display: block; max-width: min(320px, 64vw); max-height: 320px; min-width: 120px; min-height: 80px; object-fit: cover; }
.msg-pics.multi { grid-template-columns: repeat(2, 140px); }
.msg-pics.multi img { width: 140px; height: 120px; min-width: 0; min-height: 0; max-width: none; }
.msg-b.pics-only { padding: 4px; } .msg-b.pics-only .msg-pics { margin-top: 0; }
.msg-b.pics-only .att-files { margin: 6px 8px 4px; }
.att-files { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.att-files li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; min-width: 0; }
.att-files .link { min-width: 0; } .att-files .link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply { display: flex; gap: 6px; align-items: flex-end; border: 1px solid var(--field-border); background: var(--field); border-radius: 22px; padding: 4px; }
.reply textarea { flex: 1; border: 0; outline: none; background: transparent; min-width: 0; resize: none; padding: 9px 6px; max-height: 160px; line-height: 1.4; }
.reply textarea:focus-visible { outline: none; }
.reply:focus-within { border-color: color-mix(in srgb, var(--primary) 40%, var(--field-border)); }
.reply label.icon-btn { cursor: pointer; }
.reply.drop { border-color: var(--primary); border-style: dashed; }
.att-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.att-imgs a { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); line-height: 0; cursor: zoom-in; }
.att-imgs img { width: 120px; height: 90px; object-fit: cover; }
.fl-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex: none; }

/* ---------- Форма в шторке ---------- */
.step { margin: 0; padding: 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid transparent; display: grid; gap: 12px; min-width: 0; }
[data-theme="dark"] .step { background: #1a1d24; border-color: #262b34; }
.step legend { float: left; width: 100%; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; padding: 0; margin-bottom: 4px; }
.step legend + * { clear: both; }
.step-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 700; flex: none; }
.step .fld[hidden] { display: none !important; }
.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }
.where-row { display: flex; gap: 8px; align-items: center; }
.other-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.where-other { grid-template-columns: minmax(90px, .4fr) 1fr; }
.other-grid { align-items: start; }
.other.is-off .field-l { color: var(--muted); }
.other.is-off .req { opacity: .35; }
.contact { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.contact div { display: grid; } .contact small { color: var(--muted); }
[data-theme="dark"] .contact { background: #0b0d10; border: 1px solid #2a2f39; }
.drop { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 16px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 14px; cursor: pointer; text-align: center; transition: border-color .2s, background .2s; }
.drop:hover, .drop.is-over { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
[data-theme="dark"] .drop { background: #0b0d10; border-color: #3a404b; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.file-list li { display: flex; gap: 8px; align-items: center; padding: 2px 4px 2px 10px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; min-width: 0; }
.file-list .fl-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .icon-btn { width: 32px; height: 32px; }
.reply-files { margin-top: 8px; }
.rows { display: grid; gap: 10px; }
.rows-list { display: grid; gap: 10px; }
.row-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
[data-theme="dark"] .row-card { background: #14171c; }
.row-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 26px; }
.row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.row-fields > .field:has(.chips) { grid-column: 1 / -1; }   /* чипы в строке (категория ТС) — на всю ширину */
.row-card > .icon-btn { margin-top: 22px; }
.rows > .btn { justify-self: start; }
.draft-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); font-size: 13.5px; }
.draft-note .ic { color: var(--primary); width: 18px; height: 18px; }
.draft-note .link { margin-left: auto; }
.form-err { margin: 0; }

/* ---------- Профиль ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.pc[hidden] { display: none; }
.pc > .card { height: 100%; }
/* Полосы на всю ширину; «Оформление» и «Вход», «Помещения» и «Коллеги» — парами */
.pc-wide { grid-column: 1 / -1; }
.pc-wide .plain-list.tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 16px; }
.pc-wide .facts { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.install-card { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.install-card .b-ic { width: 48px; height: 48px; }
.install-card .install-text { flex: 1 1 260px; min-width: 0; }
.install-card .card-h { margin-bottom: 4px; }
.install-card .install-text p { margin: 0; }
.install-card .btn { flex: none; }
.install-card .install-ios { flex: 1 1 100%; margin: 0; }
.profile .card .hint { display: block; margin-top: 14px; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.plain-list li { display: flex; gap: 10px; align-items: flex-start; }
.plain-list li > .ic { color: var(--muted); margin-top: 2px; }
.plain-list li > span { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.plain-list small.muted { font-size: 12.5px; }
.plain-list .badge { display: inline-grid; margin-left: 6px; font-size: 11px; height: 18px; vertical-align: 1px; }
.seg-theme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.seg-theme button { justify-content: center; white-space: nowrap; }
.seg-theme .ic { width: 16px; height: 16px; flex: none; }
.pw-open { justify-self: start; margin-top: 14px; }
.pw-form { margin-top: 14px; }
.install-box { display: grid; gap: 10px; }
.install-box[hidden] { display: none; }
.install-box .btn { justify-self: start; }
.install-ios .ic { width: 16px; height: 16px; vertical-align: -3px; margin: 0 3px; color: var(--primary); }

/* ---------- Адаптив ---------- */
/* ---------- Уведомления: колокольчик, лента (notices.js), настройки в профиле (notify-prefs.js) ---------- */
.nav-tools .bell { color: var(--nav-muted); }
.bell .bell-n { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff;
  font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--nav-bg); }
.bell-pop { position: fixed; z-index: 60; top: 84px; right: max(12px, calc((100vw - 1320px) / 2)); width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bell-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 8px; }
.bell-h b { font-size: 15.5px; }
.bell-list { list-style: none; margin: 0; padding: 0 6px 6px; overflow-y: auto; overscroll-behavior: contain; }
.bell-it { display: flex; gap: 10px; padding: 10px; border-radius: 14px; color: var(--text); position: relative; }
.bell-it:hover, .bell-it:focus-visible { background: var(--surface-2); }
.bell-it.is-unread::after { content: ''; position: absolute; right: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.bell-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.bell-ic .ic { width: 18px; height: 18px; }
.bell-it.is-urgent .bell-ic { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.bell-tx { display: grid; gap: 2px; min-width: 0; padding-right: 16px; }
.bell-tx b { font-size: 14px; font-weight: 600; }
.bell-it:not(.is-unread) .bell-tx b { font-weight: 500; }
.bell-tx small { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.bell-empty { padding: 28px 16px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.bell-f { padding: 12px 16px; border-top: 1px solid var(--border); justify-content: center; }
.notify-card { grid-column: 1 / -1; }
.nt-device { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); margin-bottom: 14px; flex-wrap: wrap; }
.nt-device-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); flex: none; }
.nt-device.is-on .nt-device-ic { background: var(--primary); color: var(--primary-ink); }
.nt-device-tx { display: grid; gap: 2px; flex: 1 1 260px; min-width: 0; }
.nt-device-tx small { color: var(--muted); font-size: 13px; }
.nt-device-act { display: flex; gap: 8px; flex-wrap: wrap; }
.nt-device-act:empty { display: none; }
.nt-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 100px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.nt-head { border-top: 0; padding-top: 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.nt-row > span:not(.nt-ev) { justify-self: center; }
.nt-head > span:first-child { justify-self: start; }
.nt-ev { display: grid; gap: 2px; }
.nt-ev b { font-weight: 500; font-size: 14.5px; }
.nt-ev small { font-size: 12.5px; color: var(--muted); }
.nt-ev .nt-must { color: var(--text); }
.nt-sw i { display: none; font-style: normal; }
.nt-sw.is-fixed { cursor: default; }
.nt-sw.is-fixed span { opacity: .55; }
.nt-lock { position: absolute; left: 100%; top: 50%; margin: -8px 0 0 6px; display: grid; color: var(--muted); }   /* замок не сдвигает переключатель */
.nt-lock svg { width: 15px; height: 15px; }
.notify-card .chips { gap: 6px; }
.nt-blocks .chip-opt { min-height: 34px; font-size: 13.5px; }
.nt-devs li { align-items: center; }
.nt-devs li > span { flex: 1; }
.nt-del { width: 36px; height: 36px; }
@media (max-width: 860px) {
  .bell-pop { top: 64px; left: 8px; right: 8px; width: auto; max-height: calc(100vh - 160px - env(safe-area-inset-bottom)); }
}
@media (max-width: 640px) {
  .nt-head { display: none; }
  .nt-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 8px; }
  .nt-ev { grid-column: 1 / -1; }
  .nt-row > span:not(.nt-ev) { justify-self: start; }
  .nt-sw i { display: inline; font-size: 13px; color: var(--muted); }
  .nt-device-act { width: 100%; }
  .nt-device-act .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .bell-it { transition: none; } }

@media (max-width: 1100px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .hero { grid-column: auto; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ticket-grid, .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .dt-person { grid-template-columns: auto minmax(0, 1fr); }
  .dt-reach { grid-column: 2; justify-content: flex-start; }
  .dt-ask.is-lead p { font-size: 16px; }
  .login { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .login-media { min-height: 34vh; border-radius: 24px; }
  .login-mark .logo { width: 76px; height: 76px; }
  .login-panel { padding: 28px 20px 32px; border-radius: 24px; }
  .login-inner h1 { font-size: 30px; }
  .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); padding-top: 16px; }
  .hero { min-height: 0; padding-top: 120px; }
  .hero-stats { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .hero-stats .stat { min-width: 0; max-width: none; padding: 10px 11px; border-radius: 16px; }
  .hero-stats span { font-size: 11.5px; }
  .hero-stats b { font-size: 24px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { min-height: 0; padding: 14px; row-gap: 8px; }
  .tile-ic { margin-bottom: 4px; }
  .tile-desc { display: none; }
  .tiles > .tile[data-block="pass"], .tiles > .tile-ext { grid-row: auto; }
  .tiles > .tile[data-block="pass"] .tile-name, .tiles > .tile-ext .tile-name { margin-top: 12px; font-size: 18px; }
  .tiles > .tile[data-block="pass"] .tile-desc, .tiles > .tile-ext .tile-desc { display: block; }
  .tiles > .tile[data-block="pass"] .tile-ic, .tiles > .tile-ext .tile-ic { width: 48px; height: 48px; margin-bottom: 4px; }
  .tlist { grid-template-columns: minmax(0, 1fr); }
  .trow { grid-template-columns: auto minmax(0, 1fr); }
  .trow-side { grid-column: 2; justify-items: start; grid-auto-flow: column; align-items: center; gap: 10px; justify-content: start; }
  .confirm-box { grid-template-columns: 1fr; }
  .confirm-actions .btn { flex: 1; }
  .other-grid, .where-other { grid-template-columns: 1fr; }
  .sheet-body { padding: 14px; }
  .step { padding: 14px; }
  .sheet-f { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .sheet-f .btn-lg { flex: 1; }
  .ticket-head { gap: 12px; } .ticket-ic { width: 44px; height: 44px; }
  .page-head h1 { font-size: 26px; }
  .page .toolbar .search { flex: 1; min-width: 0; }
  .tickets-bar, .tickets-find { width: 100%; }
  .seg-tabs { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); width: 100%; border-radius: 22px; }
  .seg-tabs button { justify-content: space-between; min-width: 0; padding: 0 8px 0 10px; gap: 4px; font-size: 13.5px; }
  .seg-tabs button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row-fields { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .seg-theme button { flex-direction: column; height: auto; padding: 8px 4px; gap: 3px; font-size: 12.5px; border-radius: 16px; }
  .seg-theme { border-radius: 20px; }
  .sort-btn span { display: none; }
  .sort-btn { width: var(--h); padding: 0; justify-content: center; }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions .btn { flex: 1; }
  .msg { max-width: 94%; }
  .msg-pics.multi { grid-template-columns: repeat(2, 120px); }
  .msg-pics.multi img { width: 120px; height: 104px; }
}
