/* Страница трекера привычек /notion-widgets/habit-tracker/ (только английская; 21.10.2026 — вариант 1 прототипа
   /design-system/habit-widget/, выбор Макса). Блок «Make it yours» одной плиткой: настройки слева (главное открыто, редкое
   под «More options»), справа настоящий виджет в рамке «страница Notion» на высоту настроек, снизу полоса со ссылкой.
   Подключается через pageCss2 в странице (base.njk), логика — assets/js/nwp-habit.js. Вид — из habit-proto.css (.hp-*). */
.nwh-page{--col:1080px}
.nwh-page .tp-head{padding-bottom:34px}
.nwh [hidden]{display:none!important}

/* плитка: шапка, настройки, пример, полоса действия — области сетки */
.nwh-tile{display:grid;gap:20px 26px;padding:26px;align-items:start;grid-template-columns:minmax(0,5fr) minmax(0,7fr);grid-template-rows:auto 1fr auto;grid-template-areas:"hd pv" "cfg pv" "act act"}
.nwh-hd{grid-area:hd}.nwh-cfg{grid-area:cfg}.nwh-pv{grid-area:pv}.nwh-act{grid-area:act}
.nwh-hd h2{margin:0}
.nwh-sub{margin:6px 0 0;color:var(--mute);font-size:15px;line-height:1.5}
.nwh-cfg{min-width:0;display:flex;flex-direction:column;gap:16px}

/* поля: подпись всегда сверху, одной высоты — колонки выровнены */
.nwh-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.nwh-f{display:flex;flex-direction:column;gap:7px;min-width:0}
.nwh-f.wide{grid-column:1/-1}
.nwh-l{font-size:13px;line-height:18px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nwh-l em{font-style:normal;color:var(--mute2);margin-left:6px;font-size:12px}
.nwh-in{width:100%;min-width:0;height:40px;padding:0 12px;border:0;border-radius:10px;background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px var(--line2);color:var(--ink);font:400 15px var(--font);color-scheme:dark;box-sizing:border-box}
.nwh-in::placeholder{color:var(--mute2)}
.nwh-in:focus,.nwh-sel select:focus{outline:none;box-shadow:inset 0 0 0 1px rgba(167,139,250,.6)}
.nwh-sel{position:relative;display:block;min-width:0}
.nwh-sel select{-webkit-appearance:none;appearance:none;width:100%;height:40px;padding:0 34px 0 12px;border:0;border-radius:10px;background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px var(--line2);color:var(--ink);font:400 15px var(--font);color-scheme:dark;cursor:pointer}
.nwh-chev{width:12px;height:12px;flex:none;color:var(--mute)}
.nwh-sel .nwh-chev{position:absolute;right:12px;top:50%;margin-top:-6px;pointer-events:none}
.nwh-two{display:grid;grid-template-columns:minmax(0,1fr) 116px;gap:8px}
/* переключатель из 2–3 вариантов */
.nwh-seg{display:flex;gap:2px;height:40px;padding:3px;border-radius:10px;background:rgba(255,255,255,.035);box-shadow:inset 0 0 0 1px var(--line2);min-width:0;box-sizing:border-box}
.nwh-seg button{flex:1 1 0;min-width:0;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 8px;border:0;border-radius:7px;background:none;color:var(--mute);font:500 13.5px var(--font);white-space:nowrap;cursor:pointer;transition:background .15s,color .15s}
.nwh-seg button:hover{color:var(--ink)}
.nwh-seg button[aria-pressed="true"]{color:#fff;background:rgba(139,92,246,.24);box-shadow:inset 0 0 0 1px rgba(167,139,250,.5)}
.nwh-seg svg{width:14px;height:14px;flex:none}
.nwh-seg.only button{padding:0}
/* подпись не помещается в кнопку (длинные переводы: «Automatisch · 12-Stunden · 24-Stunden») — nwp.js segFit: плотнее и
   ширина по тексту (seg-fit), затем в две строки (seg-wrap; шрифт — там же, не мельче 10,5 px; не «wrap» — это общий
   контейнер сайта). В две строки кнопка не уже своего
   самого длинного слова (min-content): иначе «Automatisch» сжималось наравне с «12-Stunden», которое переносится */
.nwh-seg.seg-fit{gap:1px}
.nwh-seg.seg-fit button{flex:1 1 auto;padding:0 5px;gap:4px;font-size:12.5px}
.nwh-seg.seg-wrap button{white-space:normal;line-height:1.1;text-align:center;font-size:12px;min-width:min-content}
/* в узкой колонке значки у «Weeks / Month / Year» не помещаются — только текст */
.nwh-grid .nwh-f:not(.wide) .nwh-seg.ic:not(.only) svg{display:none}
/* выбор нескольких: цифры в подвале виджета */
.nwh-pills{display:flex;flex-wrap:wrap;gap:6px}
.nwh-pills button{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 12px 0 10px;border:0;border-radius:999px;background:rgba(255,255,255,.035);box-shadow:inset 0 0 0 1px var(--line2);color:var(--mute);font:500 13px var(--font);cursor:pointer}
.nwh-pills button::before{content:"";width:13px;height:13px;border-radius:4px;box-shadow:inset 0 0 0 1.5px var(--mute2);flex:none}
.nwh-pills button[aria-pressed="true"]{color:var(--ink);background:rgba(139,92,246,.14);box-shadow:inset 0 0 0 1px rgba(167,139,250,.45)}
.nwh-pills button[aria-pressed="true"]::before{box-shadow:none;background:var(--v) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/11px no-repeat}
/* привычки — плашками в поле */
.nwh-hab{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:40px;padding:5px 6px;border-radius:10px;background:rgba(255,255,255,.04);box-shadow:inset 0 0 0 1px var(--line2);cursor:text;box-sizing:border-box}
.nwh-hab:focus-within{box-shadow:inset 0 0 0 1px rgba(167,139,250,.6)}
.nwh-hc{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 3px 0 10px;border-radius:7px;background:rgba(255,255,255,.075);color:var(--ink);font-size:14px;max-width:100%;box-sizing:border-box}
.nwh-hc>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nwh-hc-dot{flex:none;width:12px;height:12px;margin-left:-3px;padding:0;border:0;border-radius:50%;background:var(--c);cursor:pointer;box-shadow:0 0 0 2px rgba(255,255,255,.14)}
.nwh-hc-x{flex:none;width:22px;height:22px;padding:0;border:0;border-radius:5px;background:none;color:var(--mute);font-size:15px;line-height:1;cursor:pointer}
.nwh-hc-x:hover{color:var(--ink);background:rgba(255,255,255,.08)}
.nwh-hab-in{flex:1;min-width:96px;height:28px;padding:0 4px;border:0;background:none;color:var(--ink);font:400 14.5px var(--font);outline:none}
.nwh-hab-in::placeholder{color:var(--mute2)}
/* цвет */
.nwh-colw{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;min-height:40px}
.nwh-acc{display:flex;gap:7px;flex-wrap:wrap}
.nwh-acc button{width:24px;height:24px;padding:0;border:0;border-radius:50%;background:var(--c);cursor:pointer;box-shadow:inset 0 0 0 2px rgba(0,0,0,.15);transition:opacity .15s}
.nwh-acc button[aria-pressed="true"]{box-shadow:0 0 0 2px var(--p1),0 0 0 4px var(--v2)}
.nwh-acc.off button{opacity:.3}.nwh-acc.off button[aria-pressed="true"]{box-shadow:inset 0 0 0 2px rgba(0,0,0,.15)}
.nwh-tg{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;background:none;color:var(--ink2);font:400 13.5px var(--font);white-space:nowrap;cursor:pointer}
.nwh-tg i{position:relative;flex:none;width:30px;height:18px;border-radius:99px;background:rgba(255,255,255,.14);transition:background .2s}
.nwh-tg i::after{content:"";position:absolute;left:2px;top:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left .2s}
.nwh-tg[aria-checked="true"] i{background:var(--v)}.nwh-tg[aria-checked="true"] i::after{left:14px}
/* цель */
.nwh-goal{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px}
.nwh-goal .nwh-seg{flex:1 1 190px;min-width:180px;max-width:280px}
.nwh-stp{display:inline-flex;align-items:center;gap:6px;height:40px;color:var(--mute);font-size:13.5px;white-space:nowrap}
.nwh-stp button{width:32px;height:32px;padding:0;border:0;border-radius:8px;background:rgba(255,255,255,.05);box-shadow:inset 0 0 0 1px var(--line2);color:var(--ink);font-size:16px;cursor:pointer}
.nwh-stp button:hover{background:rgba(255,255,255,.1)}
.nwh-stp b{min-width:22px;text-align:center;color:var(--ink);font:600 15px var(--mono)}
/* «More options» */
.nwh-more{border-top:1px solid var(--line)}
.nwh-more summary{display:flex;align-items:center;gap:10px;padding:14px 0 2px;list-style:none;cursor:pointer}
.nwh-more summary::-webkit-details-marker{display:none}
.nwh-more-t{font-weight:600;font-size:14.5px;color:var(--ink);white-space:nowrap}
.nwh-more-s{flex:1;min-width:0;font-size:13px;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nwh-more[open] .nwh-chev{transform:rotate(180deg)}
.nwh-more>.nwh-grid{margin-top:14px}

/* пример: страница Notion на высоту настроек; заметки под виджетом занимают только свободное место (height:0 +
   flex-grow), высоту блока не задают — под примером нет пустоты (замечание Макса) */
.nwh-pv{min-width:0;display:flex;flex-direction:column;align-self:stretch}
.nwh-pv>.nwp-demo{flex:1;display:flex;flex-direction:column;margin:0}
.nwh-np-page{flex:1;display:flex;flex-direction:column;gap:14px;min-height:0}
.nwh-np-t{display:flex;align-items:center;gap:10px;padding-top:2px;font:700 26px/1.2 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;letter-spacing:-.01em;color:#37352F}
.nwh-np-ic{font-size:24px}
.nwp-demo[data-theme="dark"] .nwh-np-t{color:rgba(255,255,255,.81)}
.nwh-np-embed{margin:0 -8px;padding:2px 8px;border-radius:6px;transition:box-shadow .15s}
.nwh-np-embed:hover{box-shadow:0 0 0 1px rgba(55,53,47,.09)}
.nwp-demo[data-theme="dark"] .nwh-np-embed:hover{box-shadow:0 0 0 1px rgba(255,255,255,.09)}
.nwh-frame{display:block;width:100%;height:232px;border:0;background:transparent;color-scheme:light}
.nwh-np-more{position:relative;flex:1 1 auto;height:0;min-height:0;overflow:hidden;font:15px/1.5 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;color:#37352F}
.nwh-np-more::after{content:"";position:absolute;left:0;right:0;bottom:0;height:36px;background:linear-gradient(rgba(255,255,255,0),#fff)}
.nwp-demo[data-theme="dark"] .nwh-np-more{color:rgba(255,255,255,.81)}
.nwp-demo[data-theme="dark"] .nwh-np-more::after{background:linear-gradient(rgba(25,25,25,0),#191919)}
.nwh-np-more p{display:flex;align-items:center;gap:9px;margin:0;padding:3px 2px}
.nwh-np-more p.nwh-np-h{margin-top:4px;font-weight:600;font-size:19px}
.nwh-np-more p.nwh-np-tx{display:block}
.nwh-np-more i{flex:none;width:16px;height:16px;border-radius:3px;box-shadow:inset 0 0 0 1.5px #9B9A97}
.nwh-np-more i.on{box-shadow:none;background:#2383E2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat}
.nwh-np-more p:has(i.on){color:#9B9A97;text-decoration:line-through}

/* полоса действия: ссылка и кнопки в одной строке, подпись под ними. Поле ссылки — блок .code с pre.nwp-url: по нему
   site.js размывает ссылку у гостя и после входа берёт ключ по сессии сервера; свою плашку входа site.js ставит
   после поля — здесь она не нужна (своя кнопка справа) */
.nwh-act{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 12px;min-width:0;margin:4px -26px -26px;padding:18px 26px 20px;border-top:1px solid var(--line);border-radius:0 0 var(--r3) var(--r3);background:rgba(255,255,255,.018);scroll-margin:120px}
.nwh-act>.wg-gate{display:none}
.nwh-urlw.code{position:relative;display:flex;align-items:center;gap:12px;height:46px;margin:0;padding:0 14px;border-radius:var(--r2);min-width:0}
.nwh-url-l{flex:none;font:500 12px var(--mono);color:var(--mute)}
.nwh-urlw .nwh-url{flex:1;min-width:0;margin:0;padding:0;background:none;font:400 13px/46px var(--mono);color:#E4DFF2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nwh-lock{position:absolute;right:7px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 11px;border-radius:8px;font:500 12px var(--mono);color:var(--ink2);background:rgba(23,20,31,.94);box-shadow:inset 0 0 0 1px var(--line2);white-space:nowrap}
.nwh-btns{display:flex;gap:10px;min-width:0}
.signed-in .nwh-btns button.nwp-s{display:inline-flex!important}
.nwh-note{grid-column:1/-1;margin:0;font:400 12.5px/1.5 var(--mono);color:var(--mute)}
.nwh-act .nwp-back{grid-column:1/-1;margin:0}

/* телефон и планшет: шапка блока → пример → настройки → ссылка */
@media (max-width:900px){
  .nwh-tile{padding:18px;gap:16px;grid-template-columns:minmax(0,1fr);grid-template-rows:none;grid-template-areas:"hd" "pv" "cfg" "act"}
  .nwh-act{margin:4px -18px -18px;padding:16px 18px 18px}
  .nwh-np-more{display:none}
}
@media (max-width:560px){
  /* подпись переключателя переносится (06.11.2026): на 320 px «Une couleur propre à chaque habitude» (fr) в строку не
     помещалась и уходила за край экрана вместе с замком Plus. Страж — tests/widget-page-overflow.mjs */
  .nwh-tg{white-space:normal;text-align:left;max-width:100%}
  .nwh-grid{grid-template-columns:minmax(0,1fr)}
  .nwh-act{grid-template-columns:minmax(0,1fr)}
  .nwh-btns{flex-wrap:wrap}.nwh-btns .btn,.nwh-btns .sib{flex:1 1 auto}
  .nwh-np-t{font-size:20px}.nwh-np-ic{font-size:19px}
  .nwh-np-page.nwp-demo-page{padding:12px 8px 12px}
  .nwh-lock{font-size:11.5px;padding:0 9px}
  /* плашка «Sign in to see the link» не шире поля (06.11.2026): в одну строку она была шире поля ссылки на de при экране
     меньше 395 px, на es и fr — меньше 374, на ja — меньше 347, и обрезалась слева. Теперь подпись переносится в две строки внутри
     поля. Страж — tests/widget-page-overflow.mjs */
  .nwh-lock{max-width:calc(100% - 14px);height:auto;min-height:32px;padding:3px 9px;white-space:normal;line-height:1.25;text-wrap:balance}
  .nwh-lock svg{flex:none}html[lang="ja"] .nwh-lock{word-break:auto-phrase}
  .nwh-goal .nwh-seg{flex-basis:100%;max-width:none}
  .nwh-page .tp-head{padding-bottom:24px}
}
