/* Стили окна «Новая встреча». Владелец — по карте слотов 00-plan §4; цвета только из theme.css.
   Одно главное — название; день, время и люди выбираются на месте; редкое — под «Ещё». На телефоне окно на весь экран. */
.nm-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; background: var(--w-scrim); }
.nm-window { --nm-label-col: 76px; --nm-label-gap: 12px; width: min(720px, 100%); max-height: calc(100dvh - 6vh - 16px); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); box-shadow: var(--w-pop-shadow); }
.nm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 0 24px; }
/* the head says what the window is, as the head of every window of the app does (the prototype's modal head) */
.nm-head h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--foreground); }
.nm-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 4px 24px 16px; }
.nm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; padding: 12px 24px 16px; border-top: 1px solid var(--border); }
.nm-hint { flex: 1; min-width: 0; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.nm-save-error { flex-basis: 100%; margin: 0; }

.nm-top { padding: 0 0 16px; }
.nm-title { display: block; width: 100%; padding: 0; border: 0; outline: 0; background: none; color: var(--foreground); font: inherit; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.015em; }
.nm-title::placeholder { color: var(--muted-foreground); font-weight: 500; }
.nm-title.is-bad::placeholder { color: var(--danger); }
.nm-said, .nm-note { margin: 4px 0 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.nm-said b { font-weight: 500; color: var(--foreground); }
.nm-note { display: flex; align-items: flex-start; gap: 6px; }
.nm-note .w-i { flex-shrink: 0; width: 14px; height: 14px; margin-top: 3px; }
.nm-note.is-warn { color: var(--warning); }

.nm-lines { display: flex; flex-direction: column; gap: 14px; }
.nm-line { display: grid; grid-template-columns: var(--nm-label-col) minmax(0, 1fr); column-gap: var(--nm-label-gap); align-items: start; }
.nm-label { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.nm-label .w-i { width: 12px; height: 12px; color: var(--accent-ink); }
.nm-line-body { min-width: 0; }
.nm-repeat { max-width: 260px; }
/* the rule of a series under «Повтор»: «Каждый вторник, 10:00–11:00» (repeat.js) */
.nm-rule { margin-top: 2px; }
/* Under the lines, in their column: whom the team opens the summaries to besides the participants (team.js) */
.nm-sees { margin-left: calc(var(--nm-label-col) + var(--nm-label-gap)); margin-top: 10px; }

/* «Проект»: the quiet select and the project the server suggests beside it (under it on a phone); who sees the
   summaries under them */
.nm-project-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.nm-suggest { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 32px; padding: 0 12px 0 10px; border-radius: 16px; border: 1px dashed var(--border-strong); background: none; color: var(--foreground); font: inherit; font-size: 13px; cursor: pointer; }
.nm-suggest:hover { background: var(--hover); }
.nm-suggest .w-i { flex-shrink: 0; width: 14px; height: 14px; color: var(--accent-ink); }
.nm-suggest span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nm-project .nm-row-hint, .nm-project .w-field-error { display: block; margin-top: 2px; }

/* «Когда»: a month on the left, the fields beside it */
.nm-when { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 20px; align-items: start; }
.nm-when-side { display: flex; flex-direction: column; gap: 12px; }
.nm-when-field { display: flex; flex-direction: column; gap: 4px; }
.nm-zone { margin: 0; font-size: 12px; line-height: 18px; }
.nm-free { display: flex; flex-direction: column; gap: 6px; }
.nm-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.nm-slot { height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); font-size: 13px; font-variant-numeric: tabular-nums; }
.nm-slot:hover { background: var(--hover); }

.nm-cal-head { display: flex; align-items: center; gap: 2px; height: 30px; margin-bottom: 4px; padding-left: 6px; }
.nm-cal-head b { flex: 1; font-size: 13.5px; font-weight: 560; }
.nm-turn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted-foreground); }
.nm-turn:hover:not(:disabled) { background: var(--secondary); color: var(--foreground); }
.nm-turn:disabled { opacity: .3; }
.nm-turn .w-i { width: 15px; height: 15px; }
.nm-cal-week, .nm-cal-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.nm-cal-days { min-height: 192px; align-content: start; }
.nm-cal-week span { font-size: 11.5px; line-height: 22px; color: var(--muted-foreground); }
.nm-day { width: 34px; height: 32px; display: grid; place-items: center; border-radius: 9px; font-size: 13px; color: var(--foreground); font-variant-numeric: tabular-nums; }
.nm-day:hover:not(:disabled) { background: var(--secondary); }
.nm-day.is-today { color: var(--accent-ink); font-weight: 600; }
.nm-day.is-on, .nm-day.is-on:hover { background: var(--primary-fill); color: var(--accent-fg); font-weight: 560; }
.nm-day:disabled { color: var(--muted-foreground); opacity: .4; }

/* «Кто»: the field is the picker of people (people.css); the people of an open group stand under it. On a wide screen
   the quick row wraps, every chip whole (the prototype); on a phone it scrolls sideways, as people.css draws it. */
.nm-who.is-bad .w-pfield { border-color: var(--danger); }
@media (min-width: 761px) {
  .nm-who .pp-quick { flex-wrap: wrap; overflow-x: visible; -webkit-mask-image: none; mask-image: none; }
}

/* «Шаблон»: a long line of a template wraps, in the field and in its list, rather than ending in dots; what the
   template is for stands under it in two lines at most */
.nm-window .tpl-picker .w-pick-btn { height: auto; min-height: 32px; padding-block: 6px; white-space: normal; text-align: left; }
.nm-window .tpl-picker .w-pick-val, .nm-window .tpl-picker .w-opt-text { white-space: normal; overflow-wrap: anywhere; }
.nm-window .tpl-picker .w-opt small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.nm-group { margin-top: 8px; padding: 6px 12px 8px; border-radius: 14px; border: 1px solid var(--border); }
.nm-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.nm-group-head b { font-size: 14px; font-weight: 500; }
.nm-group-list { max-height: 260px; overflow-y: auto; margin-top: 2px; }
.nm-member { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 0; }
.nm-member .pp-copy b { font-size: 14px; line-height: 20px; }
.nm-member.is-out { color: var(--muted-foreground); }
.nm-member.is-out .w-av { opacity: .5; }

/* «Ещё»: closed it says only what differs from the usual */
.nm-more { margin-top: 12px; border-top: 1px solid var(--border); }
.nm-more-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 10px 0 0; text-align: left; color: var(--foreground); font-size: 14px; font-weight: 500; }
.nm-more-toggle .w-i { flex-shrink: 0; width: 14px; height: 14px; color: var(--muted-foreground); }
.nm-more-sum { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; font-weight: 400; color: var(--muted-foreground); }
.nm-more-body { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
/* A row of «Ещё» goes across the whole width, as in the prototype: its words on the left, its control and the hint
   under it on the right, so a long label («Команда, которая видит итоги») keeps to one line and the switches and the
   selects line up on one right edge. A field of text (the description) takes the width under its label. */
.nm-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); column-gap: 16px; row-gap: 4px; align-items: start; }
.nm-field > .w-label { grid-row: 1 / span 3; display: flex; align-items: center; min-height: 40px; font-size: 14px; font-weight: 400; color: var(--foreground); }
.nm-field > :not(.w-label) { grid-column: 2; min-width: 0; }
.nm-field.is-block { display: flex; flex-direction: column; gap: 4px; }
.nm-field.is-block > .w-label { min-height: 0; }
.nm-field textarea { min-height: 88px; resize: none; font: inherit; font-size: 14px; }
.nm-row-hint, .nm-team-note { font-size: 12px; line-height: 18px; color: var(--muted-foreground); }
/* «Изменить повестку» is a quiet link under the line of the agenda, not a button across the width */
.nm-agenda > .w-link { align-self: flex-start; }
/* a switch that is a whole row, so the words are pressed too */
.nm-switch { width: 100%; display: flex; align-items: center; gap: 12px; padding: 4px 0; text-align: left; color: inherit; }
.nm-switch-copy { flex: 1; min-width: 0; }
.nm-switch b { display: block; font-weight: 500; font-size: 14px; line-height: 20px; }
.nm-switch small { display: block; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.nm-switch-mark { position: relative; flex-shrink: 0; width: 36px; height: 22px; border-radius: 11px; background: var(--switch-off); transition: background .12s ease; }
.nm-switch-mark::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); transition: transform .12s ease; }
.nm-switch[aria-checked="true"] .nm-switch-mark { background: var(--accent); }
.nm-switch[aria-checked="true"] .nm-switch-mark::after { transform: translateX(14px); }

@media (prefers-reduced-motion: reduce) {
  .nm-switch-mark, .nm-switch-mark::after { transition: none; }
}

/* the phone: the whole screen, the same order of fields */
@media (max-width: 760px) {
  .nm-backdrop { padding: 0; }
  .nm-window { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .nm-head { padding: max(8px, env(safe-area-inset-top)) 4px 0 16px; }
  .nm-body { padding: 4px 16px 16px; }
  .nm-foot { position: sticky; bottom: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: var(--card); }
  .nm-hint { flex-basis: 100%; }
  .nm-hint:empty { display: none; }
  .nm-foot .w-btn { flex: 1; height: 44px; }
  .nm-title { font-size: 20px; line-height: 28px; }
  /* A short label stands beside its value; «Когда» and «Кто» have none to see — the month and the fields say what they
     are (scr §4) — the words stay for a screen reader (as .w-sr of app.css). */
  .nm-line { grid-template-columns: auto minmax(0, 1fr); }
  .nm-label { min-height: 44px; }
  .nm-line.is-bare { display: block; }
  .nm-line.is-bare > .nm-label { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nm-field { display: flex; flex-direction: column; gap: 4px; }
  .nm-field > .w-label { min-height: 0; }
  .nm-when { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* every target of the window is at least 44 px high on a phone */
  .nm-head .w-ib { width: 44px; height: 44px; }
  .nm-cal-head { height: 44px; }
  .nm-turn { width: 44px; height: 44px; }
  .nm-day { width: 100%; height: 44px; }
  .nm-cal-days { min-height: calc(6 * 44px); }
  .nm-when-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .nm-when-side .w-input { height: 44px; }
  .nm-zone, .nm-free { grid-column: 1 / -1; }
  .nm-slot { height: 44px; border-radius: 12px; }
  .nm-window .w-pick-quiet .w-pick-btn { min-height: 44px; }
  .nm-who .pp-quick-chip { height: 44px; }
  .nm-more-toggle { min-height: 44px; }
  .nm-repeat { max-width: none; }
  .nm-sees { margin-left: 0; }
  .nm-suggest { height: 44px; border-radius: 12px; }
}
