.home-drag-ready {
  width: fit-content;
  max-width: 100%;
  margin: 12px auto 4px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font:500 calc(11px * var(--ui-font-scale, 1))/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
}

.home-drag-ready:disabled {
  opacity: 1;
  cursor: default;
}

.home-drag-ready:not(.is-add) span {
  min-width: 0;
  font-size:clamp(calc(8px * var(--ui-font-scale, 1)), calc(2.3vw * var(--ui-font-scale, 1)), calc(9px * var(--ui-font-scale, 1)));
  letter-spacing: -.015em;
  text-align: center;
  white-space: nowrap;
}

.home-drag-ready.is-add {
  color: #aa98ff;
  font-size:calc(13px * var(--ui-font-scale, 1));
  font-weight: 800;
}

.home-drag-ready.is-add b {
  font-size:calc(20px * var(--ui-font-scale, 1));
  font-weight: 500;
  line-height: 1;
}

.home-drag-ready.is-add:active {
  transform: scale(.98);
}

.home-cards {
  margin-top: -8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.home-cards > [data-home-card] {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  margin: 0 !important;
}

.home-card-remove {
  position: absolute;
  z-index: 30;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(8, 17, 31, .94);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  color: #fff;
  font:500 calc(22px * var(--ui-font-scale, 1))/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: scale(.55);
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}

.home-reorder-mode .home-card-remove {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.home-card-remove:active {
  transform: scale(.86);
}

.home-cards .home-card-block,
.home-cards .home-card-block > .card,
.home-cards > .card {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.home-cards .card {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 18px;
  overflow: hidden;
}

.home-cards .card h2 {
  display: -webkit-box;
  margin: 10px 0 5px;
  overflow: hidden;
  font-size:calc(16px * var(--ui-font-scale, 1));
  line-height: 1.18;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-cards .focus-card p {
  margin: 0 0 6px;
  overflow: hidden;
  font-size:calc(10px * var(--ui-font-scale, 1));
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-cards .focus-card-top strong {
  max-width: 58px;
  font-size:calc(9px * var(--ui-font-scale, 1));
  text-align: right;
}

.home-cards .focus-footer {
  margin-top: auto;
  padding-top: 8px;
  gap: 7px;
  font-size:calc(8px * var(--ui-font-scale, 1));
  line-height: 1.25;
}

.home-cards .focus-footer b {
  max-width: 68px;
  text-align: right;
}

.home-cards .ai-card {
  position: relative;
}

.home-cards .ai-card .ai-orb {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  font-size:calc(12px * var(--ui-font-scale, 1));
}

.home-cards .ai-card h2 {
  margin-top: 16px;
}

.home-cards .ai-card .muted {
  display: -webkit-box;
  overflow: hidden;
  font-size:calc(10px * var(--ui-font-scale, 1));
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-cards .link-arrow {
  margin-top: auto;
  padding-top: 7px;
  font-size:calc(10px * var(--ui-font-scale, 1));
}

.home-cards .discussion-top {
  grid-template-columns: 28px minmax(0, 1fr) 8px;
  gap: 6px;
}

.home-cards .discussion-icon {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size:calc(10px * var(--ui-font-scale, 1));
}

.home-cards .discussion-card > p {
  margin-bottom: 6px;
  font-size:calc(9px * var(--ui-font-scale, 1));
  line-height: 1.35;
}

.home-cards .discussion-meta {
  margin-top: auto;
  padding-top: 7px;
  gap: 5px;
  font-size:calc(7px * var(--ui-font-scale, 1));
}

.home-cards .discussion-meta strong {
  text-align: right;
}

.home-cards .news-card h2 {
  max-width: none;
  -webkit-line-clamp: 3;
}

.home-cards .news-card p {
  display: -webkit-box;
  max-width: none;
  margin: 0 0 6px;
  overflow: hidden;
  font-size:calc(9px * var(--ui-font-scale, 1));
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 350px) {
  .home-cards { gap: 9px; }
  .home-cards .card { padding: 12px; border-radius: 16px; }
  .home-cards .card h2 { font-size:calc(14px * var(--ui-font-scale, 1)); }
  .home-cards .news-card p { -webkit-line-clamp: 1; }
}

.home-drag-ready i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(51, 214, 159, .1);
}

.home-draggable-card {
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}

.home-layout-sheet,
.home-layout-sheet *,
body.home-route main#app.screen,
body.home-route .home-cards,
body.home-route .home-drag-ready {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body.home-route input,
body.home-route textarea,
body.home-route [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.home-draggable-card.home-card-pressing {
  transform: scale(.97);
  filter: brightness(1.07);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), filter .18s ease;
}

.home-draggable-card.home-card-dragging {
  cursor: grabbing;
  opacity: .99;
  filter: brightness(1.1) saturate(1.04);
  box-shadow: 0 30px 76px rgba(0, 0, 0, .52), 0 8px 24px rgba(126, 101, 238, .28) !important;
  will-change: transform;
  transition: none !important;
}

.home-card-delete-sheet {
  text-align: center;
}

.home-card-delete-mark {
  width: 48px;
  height: 48px;
  margin: 2px auto 13px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 92, 108, .14);
  color: #ff7c8a;
  font-size:calc(31px * var(--ui-font-scale, 1));
  line-height: 1;
}

.home-card-delete-sheet > p {
  margin: 7px 0 18px;
  font-size:calc(13px * var(--ui-font-scale, 1));
  line-height: 1.45;
}

.home-card-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.home-card-delete-actions button {
  min-height: 48px;
  border-radius: 14px;
  font-size:calc(14px * var(--ui-font-scale, 1));
  font-weight: 800;
}

.home-card-delete-actions .danger {
  border: 1px solid rgba(255, 92, 108, .3);
  background: rgba(255, 92, 108, .16);
  color: #ff8995;
}

.home-card-placeholder {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 22px;
  background: rgba(126, 101, 238, .08);
  box-shadow: inset 0 0 0 2px rgba(146, 124, 255, .22);
  animation: home-placeholder-breathe .72s ease-in-out infinite alternate;
}

@keyframes home-placeholder-breathe {
  from { opacity: .58; transform: scale(.975); }
  to { opacity: 1; transform: scale(1); }
}

html[data-theme="light"] .home-card-placeholder {
  background: rgba(22, 136, 98, .07);
  box-shadow: inset 0 0 0 2px rgba(22, 136, 98, .18);
}

body.home-route .home-ai-search {
  bottom: 134px !important;
}

body.home-route .screen {
  padding-bottom: 210px;
}

body.home-route {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

body.home-route .app-shell,
body.home-route .screen {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.notification strong,
.notification-main strong {
  font-size:calc(17px * var(--ui-font-scale, 1)) !important;
  line-height: 1.3;
}

.notification p,
.notification-main p {
  margin: 6px 0 !important;
  font-size:calc(14px * var(--ui-font-scale, 1)) !important;
  line-height: 1.45 !important;
}

.notification small,
.notification-main small {
  font-size:calc(12px * var(--ui-font-scale, 1)) !important;
  line-height: 1.35;
}

.notification-actions button {
  min-height: 42px;
  font-size:calc(13px * var(--ui-font-scale, 1)) !important;
}

/* Слой для плитки, которую тащат (см. home-drag.js): с классом сетки, чтобы
   плитка сохраняла вид, но сам он ничего не занимает и не ловит касания. */
.home-cards.home-drag-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: block;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.home-cards.home-drag-layer > .home-card-dragging { animation: none; }
