/* ============================================================
   ОБЪЯВЛЕНИЯ v433: список по дате события, страница с ознакомлением,
   «Ознакомлен(а)» у важных. Свой слой, классы nw-, опирается на tk-.
   ============================================================ */

:root { --nw-date-bg: var(--surface-selected, #fbeef3); --nw-date-ink: var(--tk-accent, #7f1438); }

.nw-list {
  display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface-card); box-shadow: var(--shadow);
}
.nw-list.is-past { opacity: .92; }
.nw-card {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 210px 32px; gap: 16px; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line-soft, var(--line)); cursor: pointer;
}
.nw-card:last-child { border-bottom: 0; }
.nw-card:hover .nw-title b { color: var(--tk-accent, var(--brand)); }
.nw-card:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.nw-date {
  display: grid; justify-items: center; width: 58px; padding: 7px 0 6px; border-radius: 12px;
  background: var(--nw-date-bg); color: var(--nw-date-ink); line-height: 1.05; text-align: center;
}
.nw-date b { font-size: 21px; }
.nw-date small { font-size: 10.5px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.nw-date em { margin-top: 2px; font-size: 10.5px; font-style: normal; font-weight: 700; opacity: .8; }
.nw-date.is-empty { padding: 14px 0; }
.nw-list.is-past .nw-date { background: var(--surface-hover); color: var(--text-soft); }
.nw-body { min-width: 0; }
.nw-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.nw-title b { color: var(--text); font-size: 15px; font-weight: 800; }
.nw-card.is-unread .nw-title b { color: var(--text); }
.nw-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.nw-body p {
  margin: 3px 0 7px !important; overflow: hidden; color: var(--muted) !important; font-size: 12.8px !important;
  line-height: 1.45; text-overflow: ellipsis; white-space: nowrap;
}
.nw-when { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); font-weight: 700; }
.nw-when .tk-ico { width: 13px; height: 13px; }
.nw-when em { color: var(--tk-accent, var(--brand)); font-style: normal; }
.nw-prog { min-width: 0; }
.nw-prog > div { display: flex; align-items: baseline; gap: 6px; }
.nw-prog b { color: var(--text); font-size: 14px; }
.nw-prog small { color: var(--muted); font-size: 12px; }
.nw-prog .tk-bar { margin: 6px 0 0; }
.nw-prog.is-wait small { color: var(--muted); }
.nw-state { justify-self: start; padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.nw-state .tk-ico { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.nw-state.is-read { background: var(--state-ok-bg, #e4f6ef); color: var(--state-ok, #0f7a5f); }
.nw-state.is-need { background: var(--state-warn-bg, #fdf3e0); color: var(--state-warn, #96660d); }
.nw-state.is-new { background: var(--surface-selected); color: var(--tk-accent, var(--brand)); }

/* ---- Страница ---- */
.nw-event {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-card-2); color: var(--text); font-size: 14px;
}
.nw-event .tk-ico { width: 17px; height: 17px; color: var(--tk-accent, var(--brand)); }
.nw-event span { color: var(--tk-accent, var(--brand)); font-weight: 800; }
.nw-text { margin-bottom: 4px; }
.nw-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.nw-link {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 11px; background: var(--surface-card-2); color: var(--text); text-decoration: none;
}
.nw-link:hover { border-color: var(--brand); }
.nw-link .tk-ico { width: 17px; height: 17px; color: var(--tk-accent, var(--brand)); }
.nw-link b { display: block; font-size: 13px; }
.nw-link small { display: block; color: var(--muted); font-size: 11.5px; }
.nw-head .portal-attachments { margin-top: 14px; }
.nw-ack {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 0 0 14px; padding: 12px 14px;
  border: 1.5px solid color-mix(in srgb, var(--brand) 50%, var(--line)); border-radius: 14px;
  background: var(--surface-selected);
}
.nw-ack > div { flex: 1 1 240px; }
.nw-ack b { display: block; color: var(--text); font-size: 14px; }
.nw-ack small { display: block; color: var(--muted); font-size: 12px; }
.nw-ack .primary { display: inline-flex; align-items: center; gap: 6px; }
.nw-acked {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px !important; padding: 5px 10px; border-radius: 9px;
  background: var(--state-ok-bg, #e4f6ef); color: var(--state-ok, #0f7a5f) !important; font-size: 12.5px !important; font-weight: 800;
}
.nw-side header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nw-side header b { color: var(--text); font-size: 15px; }
.nw-side > .tk-bar { margin: 8px 0 4px; }
.nw-side h3 {
  display: flex; align-items: center; gap: 6px; margin: 16px 0 8px; color: var(--muted);
  font-size: 11px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase;
}
.nw-side h3 span { padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-card); color: var(--text); font-size: 11.5px; letter-spacing: 0; }
.nw-centers { display: grid; gap: 4px; }
.nw-center summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 2px;
  cursor: pointer; list-style: none;
}
.nw-center summary::-webkit-details-marker { display: none; }
.nw-center summary b { color: var(--text); font-size: 13px; }
.nw-center ul { display: grid; gap: 3px; margin: 4px 0 8px; padding: 0 0 0 10px; color: var(--text-soft); font-size: 12.5px; list-style: none; }
.nw-all { margin: 12px 0 0 !important; color: var(--state-ok, #0f7a5f) !important; font-size: 13px !important; font-weight: 700; }

/* ---- Форма ---- */
dialog:has(> form.nw-form) { width: min(640px, calc(100% - 24px)); }
dialog > form.nw-form { display: grid; gap: 14px; padding: 20px 22px; }
.nw-when-fields { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.nw-form textarea[name="text"] { min-height: 150px; }
.nw-for { display: grid; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.nw-for legend { padding: 0 4px; color: var(--text); font-size: 12px; font-weight: 800; }
.nw-for-list { display: flex; flex-wrap: wrap; gap: 6px; }
.nw-for-item {
  display: inline-flex !important; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 12.5px !important; font-weight: 700 !important; cursor: pointer;
}
.nw-for-item:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--surface-selected); color: var(--tk-accent, var(--brand)); }
.nw-for-item:has(input:disabled) { opacity: .55; cursor: default; }
.nw-for-item input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }
.nw-for small { color: var(--muted); font-size: 11.5px; }
.nw-important {
  display: flex !important; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; font-weight: 500 !important; cursor: pointer;
}
.nw-important input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.nw-important b { display: block; font-size: 13px; }
.nw-important small { display: block; color: var(--muted); font-size: 11.5px; }

@media (max-width: 720px) {
  .nw-card { grid-template-columns: 52px minmax(0, 1fr) 30px; grid-template-areas: "date body menu" "date prog prog"; gap: 6px 12px; padding: 12px; }
  .nw-card .nw-date { grid-area: date; width: 52px; align-self: start; }
  .nw-card .nw-body { grid-area: body; }
  .nw-card .nw-prog, .nw-card .nw-state { grid-area: prog; }
  .nw-card > .tk-icon-btn, .nw-card > span:last-child { grid-area: menu; align-self: start; }
  .nw-body p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
  .nw-when-fields { grid-template-columns: 1fr 1fr; }
  .nw-when-fields label:first-child { grid-column: 1 / -1; }
  .nw-ack .primary { width: 100%; justify-content: center; }
  dialog > form.nw-form { padding: 16px; }
}
