/* Связь. Обе вкладки остаются на одном месте при смене пустого списка. */
#phone-app:is([data-app="messages"], [data-app="calls"]) {
  background: radial-gradient(ellipse at 53% 26%, #20363255, transparent 61%);
}
#phone-call-list {
  display: flex; flex: none; gap: 3px; padding: 3px; margin: 3px 3px 0;
  border: 1px solid #34453e; border-radius: 12px; background: #141e1c;
}
#city-phone #phone-call-list button {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 2px; border-radius: 9px;
  background: transparent; color: #abc0b1; font-size: 13px;
}
#city-phone #phone-call-list [aria-pressed="true"] { background: #30463c; color: #f2f7ee; box-shadow: 0 1px 2px #0004; }
#phone-empty {
  --empty-accent: #70dec2; display: flex; flex: 1 0 auto; flex-direction: column;
  align-items: center; justify-content: center; gap: 19px; padding: 14px 6px 40px;
}
#phone-empty:has([data-section="messages"]) { --empty-accent: #a0b3ff; }
#phone-empty:has([data-section="contacts"]) { --empty-accent: #f2bc7a; }
.phone-empty-icon { position: relative; display: grid; place-items: center; width: 86px; height: 82px; isolation: isolate; }
.phone-empty-icon::before, .phone-empty-icon::after {
  content: ''; position: absolute; inset: 6px 8px; z-index: -1; border: 1px solid #405b4d; border-radius: 20px;
}
.phone-empty-icon::before {
  transform: rotate(-12deg) translate(-4px,-3px); background: #24352e;
  background: color-mix(in srgb, var(--empty-accent) 13%, #152321);
}
.phone-empty-icon::after {
  transform: rotate(7deg) translate(2px,1px); background: #34463e; box-shadow: inset 0 1px #ffffff17;
  background: linear-gradient(145deg, color-mix(in srgb, var(--empty-accent) 34%, #0c1c19), color-mix(in srgb, var(--empty-accent) 11%, #142321));
  border-color: color-mix(in srgb, var(--empty-accent) 44%, #263c30);
}
#city-phone .phone-empty-icon svg { display: none; width: 35px; height: 35px; background: none; color: var(--empty-accent); }
#phone-empty:has([data-section="messages"]) .empty-messages,
#phone-empty:has([data-section="calls"]) .empty-calls,
#phone-empty:has([data-section="contacts"]) .empty-contacts { display: block; }
#phone-note {
  margin: 0; max-width: 13ch; color: #f7f3e9; text-align: center;
  font-size: 21px; font-weight: 600; line-height: 1.16; letter-spacing: -.035em;
}

/* Новости. Статья прокручивается отдельно от стрелки назад и полоски сворачивания. */
#phone-app:is([data-app="news"], [data-app="camera"]) { padding-inline: 0; overflow: hidden; }
#phone-news { display: flex; flex: 1; min-height: 0; }
#news-feed, #news-article {
  flex: 1; min-width: 0; padding: 5px 10px 12px; overflow: auto;
  overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin;
}
#city-phone .news-lead, #city-phone .news-row { position: relative; width: 100%; overflow: hidden; text-align: left; }
#city-phone .news-lead {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 7px;
  height: clamp(130px, 61%, 255px); padding: 14px; border: 1px solid #56706f; border-radius: 17px;
  background: #203135; color: #fff9ef; isolation: isolate;
}
.news-lead > img, .news-lead::after { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.news-lead > img { object-fit: cover; object-position: 56% 35%; }
.news-lead::after { content: ''; background: linear-gradient(0deg, #111916 2%, #142327f2 13%, #10181a83 48%, transparent 70%); pointer-events: none; }
.news-lead small {
  position: absolute; top: 11px; left: 11px; padding: 5px 8px; border: 1px solid #a5bfa06b; border-radius: 18px;
  background: #1a2723; color: #eff0cd; font: 650 11px/1.15 system-ui,sans-serif;
}
.news-lead strong { max-width: 8em; font: 500 34px/.99 Georgia,serif; letter-spacing: -.045em; }
.news-lead span { max-width: 16em; color: #e5e5da; font: 12px/1.4 system-ui,sans-serif; }
#news-feed ul { list-style: none; margin: 10px 0 0; padding: 0; }
#news-feed li + li { margin-top: 6px; }
#city-phone .news-row {
  display: grid; grid-template-columns: 29% minmax(0,1fr) 8px; align-items: center; gap: 9px; min-height: 75px;
  padding: 7px; border: 1px solid #43504a; border-radius: 14px; background: #1c2827; color: #f7f3e9;
}
.news-row strong { font: 600 15px/1.23 system-ui,sans-serif; letter-spacing: -.03em; }
.news-row img { display: block; width: 100%; aspect-ratio: 1.25; object-fit: contain; border-radius: 8px; background: radial-gradient(ellipse at 60% 32%, #777769, #424b46); }
.news-row::after { content: '›'; color: #bdc9bd; font-size: 20px; }
#news-article { padding-inline: 7px; }
.news-paper { overflow: hidden; border-radius: 13px; background: #f0ece1; color: #282c28; }
.news-paper > img { display: block; width: 100%; aspect-ratio: 1.85; object-fit: cover; }
.news-body { padding: 16px 14px 19px; }
#news-title { margin: 0; font: 500 30px/1.03 Georgia,serif; letter-spacing: -.045em; overflow-wrap: break-word; }
#news-title:focus { outline: 0; }
.news-body p { margin: 0; font: 400 14px/1.5 system-ui,sans-serif; }
.news-body > p { margin-top: 12px; padding-bottom: 14px; border-bottom: 1px solid #d0cebf; color: #474d42; }
.news-body section { margin-top: 16px; }
.news-body section img { display: block; width: 100%; aspect-ratio: 2.2; object-fit: contain; margin-bottom: 9px; border-radius: 9px; background: radial-gradient(ellipse at 60% 26%, #eae9d9, #b6baaa); }
.news-body h4 { margin: 0 0 5px; font: 700 17px/1.18 Georgia,serif; }

/* Камера. При смене экранов анимируется контейнер, у холста своё отражение по вертикали. */
#phone-camera { position: relative; display: flex; flex: 1; min-height: 0; flex-direction: column; background: #101515; }
#cam-stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; margin: 0 8px;
  border: 1px solid #414c47; border-radius: 14px; background: #101615;
}
#cam-view, #cam-photo { display: block; width: 100%; height: 100%; object-fit: contain; }
#cam-view { cursor: grab; touch-action: none; transform: scaleY(-1); }
#cam-view:active { cursor: grabbing; }
.cam-focus {
  --corner: linear-gradient(#ffe6a5,#ffe6a5); position: absolute; inset: 50% auto auto 50%; width: 36px; height: 36px;
  transform: translate(-50%,-50%); pointer-events: none; opacity: .85;
  background: var(--corner) top left / 9px 1px, var(--corner) top left / 1px 9px,
    var(--corner) top right / 9px 1px, var(--corner) top right / 1px 9px,
    var(--corner) bottom left / 9px 1px, var(--corner) bottom left / 1px 9px,
    var(--corner) bottom right / 9px 1px, var(--corner) bottom right / 1px 9px; background-repeat: no-repeat;
}
#cam-view[hidden] ~ .cam-focus { display: none; }
#cam-hint, #cam-error {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); padding: 3px 8px;
  border: 1px solid #ffffff29; border-radius: 14px; background: #14201cde; color: #f5f2e7;
  font-size: 11px; white-space: nowrap; pointer-events: none;
}
#cam-error { bottom: 66px; width: 94%; white-space: normal; text-align: center; }
#cam-controls, #cam-review { display: flex; align-items: center; justify-content: space-evenly; flex: none; padding: 9px 7px 5px; }
#city-phone #cam-controls button {
  display: grid; place-items: center; align-content: center; gap: 3px; min-width: 44px; min-height: 46px;
  padding: 0 2px; border-radius: 10px; color: #ecefe6; font-size: 11px;
}
#city-phone #cam-controls svg { width: 21px; height: 21px; color: inherit; background: none; }
#city-phone #cam-shutter {
  width: 55px; height: 55px; padding: 3px; border: 2px solid #e9ebe4; border-radius: 50%;
  align-content: stretch; align-items: stretch; justify-items: stretch; background: #1c2421;
}
#cam-shutter::after { content: ''; border-radius: 50%; background: linear-gradient(150deg, #fffff6, #d9dfd2); }
#cam-shutter:active::after { background: #d0c6a2; }
#cam-controls :disabled { opacity: .5; }
#cam-review { gap: 6px; }
#city-phone :is(#cam-review, #cam-confirm) button {
  flex: 1; min-width: 44px; min-height: 44px; padding: 5px; border: 1px solid #47584d; border-radius: 10px;
  background: #22312b; color: #f2f3e9; font: 600 13px/1.2 system-ui,sans-serif;
}
#city-phone #cam-review #cam-download, #city-phone #cam-confirm #cam-save { background: #d9e8d7; border-color: #d9e8d7; color: #1d3328; }
#cam-confirm { position: absolute; inset: 0; display: grid; align-items: end; padding: 9px 7px; background: #0a100dc4; }
#cam-confirm > div {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 10px 10px; border: 1px solid #4b6054; border-radius: 14px;
  color: #f7f3e9; background: #1e2b27; box-shadow: 0 8px 22px #0004;
}
#cam-question { width: 100%; margin: 0 0 6px; font-size: 18px; line-height: 1.2; letter-spacing: -.025em; }

@media (max-height: 520px), (max-width: 600px) {
  #phone-empty { gap: 7px; padding: 4px 0 10px; }
  .phone-empty-icon { width: 50px; height: 47px; }
  .phone-empty-icon::before, .phone-empty-icon::after { inset: 4px 5px; border-radius: 12px; }
  #city-phone .phone-empty-icon svg { width: 22px; height: 22px; }
  #phone-note { font-size: 14px; }
  #phone-call-list { margin: 0; gap: 1px; padding: 1px; }
  #city-phone #phone-call-list button { font-size: 11px; }
  #city-phone:has(#phone-news:not([hidden])) .phone-status { display: none; }
  #news-feed, #news-article { padding: 3px 4px 5px; }
  #news-feed ul { margin-top: 4px; }
  #city-phone .news-lead { height: clamp(72px, calc(100% - 53px), 172px); gap: 2px; border-radius: 10px; padding: 6px; }
  .news-lead small { top: 4px; left: 4px; padding: 2px 5px; font-size: 9px; }
  .news-lead strong { max-width: none; font-size: 19px; }
  .news-lead span { font-size: 10.5px; line-height: 1.15; }
  #city-phone .news-row { min-height: 44px; border-radius: 9px; padding: 3px; gap: 5px; grid-template-columns: 25% minmax(0,1fr) 4px; }
  .news-row strong { font-size: 12px; }
  .news-row::after { font-size: 12px; }
  #news-title { font-size: 20px; }
  .news-body { padding: 8px; }
  .news-body p { font-size: 12px; line-height: 1.42; }
  .news-body h4 { font-size: 15px; }
  #cam-stage { margin-inline: 3px; border-radius: 8px; }
  #cam-controls, #cam-review { padding: 1px 0; gap: 0; }
  #city-phone #cam-controls button, #city-phone #cam-shutter { min-height: 44px; height: 44px; }
  #city-phone #cam-shutter { width: 44px; }
  #cam-confirm { padding: 3px; }
  #cam-confirm > div { padding: 7px 4px 4px; gap: 3px; }
  #cam-question { font-size: 14px; }
  #city-phone :is(#cam-review, #cam-confirm) button { font-size: 11.5px; padding: 3px 1px; }
  #cam-error { bottom: 46px; }
}
@media (max-height: 520px) {
  #city-phone:has(#phone-camera:not([hidden])) .phone-status { display: none; }
  #city-phone:has(#phone-camera:not([hidden])) .phone-glass { position: relative; }
  #city-phone:has(#phone-camera:not([hidden])) #phone-pocket { position: absolute; inset: 0 0 auto auto; width: 44px; height: 44px; }
  #city-phone:has(#phone-camera:not([hidden])) #phone-pocket span { display: none; }
  #city-phone:has(#phone-camera:not([hidden])) #phone-pocket svg { display: block; position: static; width: 16px; }
  #phone-app[data-app="camera"] > header { flex: none; padding-right: 44px; gap: 0; font-size: 12px; }
}
@media (max-width: 760px) and (orientation: landscape) {
  .touch #city-phone:has(#phone-camera:not([hidden])) { --phone-left: calc(24px + 156px * var(--tb)); }
  .news-lead strong { font-size: 16px; }
}
/* На узком стекле вкладки занимают 44 px. Оставляем обе строки сообщения над нижней полосой. */
@container (max-width: 159px) {
  #phone-app[data-app="calls"] #phone-empty { gap: 3px; padding: 2px 0; }
  #phone-app[data-app="calls"] .phone-empty-icon { width: 38px; height: 34px; }
  #phone-app[data-app="calls"] .phone-empty-icon::before, #phone-app[data-app="calls"] .phone-empty-icon::after { inset: 3px; border-radius: 9px; }
  #phone-app[data-app="calls"] #phone-note { font-size: 13px; }
}
