/* Nightwatch — "try it right here": an HTML model of Last Night, History, Right Now and Battery. Loaded only on nightwatch.newmac.app. */
.nw {
  --nw-win: #f1f0ee; --nw-side: #e8e7e4; --nw-card: #faf9f6; --nw-line: rgba(0,0,0,.09); --nw-ink: #1c1b22; --nw-mut: #7c7a80; --nw-sel: rgba(0,0,0,.08);
  --s-asleep: #2e1d63; --s-dark: #d6455d; --s-off: #e6b4b8; --s-on: #b8862b; --nw-bat: #55535c; --nw-red: #c9475e;
  height: 660px; display: grid; grid-template-rows: 52px 1fr; color: var(--nw-ink); background: var(--nw-win); font-family: var(--font); user-select: none; -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nw { --nw-win: #1c1b20; --nw-side: #232227; --nw-card: #26252c; --nw-line: rgba(255,255,255,.09); --nw-ink: #ecebef; --nw-mut: #9d9aa3; --nw-sel: rgba(255,255,255,.08); --s-asleep: #4b3a9c; --s-off: #7c4f5a; --s-on: #c99a45; --nw-bat: #c8c6cf; --nw-red: #f07a8c; } }
:root[data-theme="dark"] .nw { --nw-win: #1c1b20; --nw-side: #232227; --nw-card: #26252c; --nw-line: rgba(255,255,255,.09); --nw-ink: #ecebef; --nw-mut: #9d9aa3; --nw-sel: rgba(255,255,255,.08); --s-asleep: #4b3a9c; --s-off: #7c4f5a; --s-on: #c99a45; --nw-bat: #c8c6cf; --nw-red: #f07a8c; }
.nw button { font: inherit; color: inherit; }
.nw .mono { font-family: var(--font-mono); }
.nw-top { display: grid; grid-template-columns: 190px 1fr auto; align-items: center; border-bottom: 1px solid var(--nw-line); }
.nw-top .lights { padding-left: 18px; }
.nw-top b { padding-left: 16px; font-size: 15px; color: var(--nw-mut); }
.nw-top button { margin-right: 14px; border: 0; background: none; width: 28px; height: 28px; border-radius: 7px; cursor: pointer; color: var(--nw-mut); font-size: 16px; }
.nw-top button:hover { background: var(--nw-sel); }
.nw-body { display: grid; grid-template-columns: 190px 1fr; min-height: 0; }
.nw-side { background: var(--nw-side); border-right: 1px solid var(--nw-line); padding: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.nw-side .sec { font-size: 11px; font-weight: 600; color: var(--nw-mut); margin: 12px 8px 4px; }
.nw-nav { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 7px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; }
.nw-nav:hover { background: var(--nw-sel); }
.nw-nav[aria-current="true"] { background: color-mix(in srgb, var(--nw-ink) 12%, transparent); }
.nw-nav i { font-style: normal; width: 16px; text-align: center; opacity: .7; }
.nw-nav .n { margin-left: auto; color: var(--nw-red); font-size: 11px; font-weight: 700; }
.nw-samp { margin-top: auto; font-size: 10.5px; color: var(--nw-mut); padding: 8px; line-height: 1.4; }
.nw-samp b { font-family: var(--font-mono); font-weight: 600; letter-spacing: .06em; color: var(--nw-ink); display: flex; gap: 6px; align-items: center; }
.nw-samp b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--s-asleep); }
.nw-main { overflow-y: auto; padding: 22px 26px 26px; min-height: 0; scrollbar-width: thin; }
.nw-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--nw-mut); text-transform: uppercase; }
.nw-titlerow { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.nw-titlerow .nw-h { margin: 0; font-size: 21px; letter-spacing: -.01em; }
.nw-tag { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; color: #a2700f; border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; }
.nw-pn { display: flex; border-radius: 8px; box-shadow: 0 0 0 1px var(--nw-line); overflow: hidden; }
.nw-pn button { border: 0; background: var(--nw-card); width: 30px; height: 26px; cursor: pointer; font-size: 14px; }
.nw-pn button:disabled { opacity: .35; cursor: default; }
.nw-pn button + button { border-left: 1px solid var(--nw-line); }
.nw-seg { display: flex; border-radius: 8px; box-shadow: 0 0 0 1px var(--nw-line); overflow: hidden; margin-left: auto; }
.nw-seg button { border: 0; background: var(--nw-card); padding: 4px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nw-seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--nw-ink) 12%, transparent); }
.nw-sum { font-size: 17px; line-height: 1.4; margin: 0 0 14px; max-width: 760px; }
.nw-stats { display: flex; gap: 30px; align-items: flex-end; flex-wrap: wrap; }
.nw-stat b { display: block; font-family: var(--font-mono); font-size: 17px; font-weight: 600; }
.nw-stat small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--nw-mut); text-transform: uppercase; }
.nw-stat.red b { color: var(--nw-red); }
.nw-rest { margin-left: auto; text-align: right; font-size: 12px; color: var(--nw-mut); }
.nw-rest b { font-family: var(--font-mono); font-size: 19px; color: var(--nw-ink); margin: 0 4px; }
.nw-rest .ticks { display: flex; gap: 2px; justify-content: flex-end; margin-top: 4px; }
.nw-rest .ticks i { width: 2px; height: 9px; background: color-mix(in srgb, var(--nw-ink) 18%, transparent); }
.nw-rest .ticks i.on { background: var(--nw-ink); }
.nw-why { font-size: 13px; color: var(--nw-mut); margin: 10px 0 18px; max-width: 760px; }
.nw-card { background: var(--nw-card); border-radius: 12px; box-shadow: 0 0 0 1px var(--nw-line); padding: 14px 16px; margin-bottom: 16px; }
.nw-card > header { display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--nw-mut); margin-bottom: 8px; }
.nw-card > header b { color: var(--nw-ink); font-weight: 600; }

/* Hypnogram */
.nw-hyp { position: relative; touch-action: pan-y; cursor: ew-resize; outline: none; border-radius: 8px; }
.nw-hyp:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-dark) 50%, transparent); }
.nw-hyp svg { display: block; width: 100%; height: auto; overflow: visible; }
.nw-hyp text { font-family: var(--font-mono); font-size: 10px; fill: var(--nw-mut); }
.nw-hyp .grid { stroke: var(--nw-line); }
.nw-hyp .bat { fill: none; stroke: var(--nw-bat); stroke-width: 1.2; opacity: .8; }
.nw-hyp .scrub { stroke: var(--nw-ink); stroke-width: 1.4; }
.nw-tip { position: absolute; top: 34px; transform: translateX(-50%); background: var(--nw-card); box-shadow: 0 0 0 1px var(--nw-line), 0 6px 18px rgba(0,0,0,.12); border-radius: 8px; padding: 6px 10px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; }
.nw-tip b { font-family: var(--font-mono); }
.nw-tip .st { font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .05em; margin: 0 6px; }
.nw-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 10.5px; color: var(--nw-mut); margin-top: 8px; letter-spacing: .04em; }
.nw-legend span { display: inline-flex; gap: 6px; align-items: center; }
.nw-legend span::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.nw-legend span.thin::before { width: 2px; }
.nw-legend b { color: var(--nw-ink); font-weight: 600; }
.nw-legend .bt { margin-left: auto; }

/* Tables and logbook */
.nw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nw-table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .06em; color: var(--nw-mut); padding: 6px 4px; border-bottom: 1px solid var(--nw-line); }
.nw-table td { padding: 9px 4px; border-bottom: 1px solid var(--nw-line); vertical-align: middle; }
.nw-table tr:last-child td { border-bottom: 0; }
.nw-table td small { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--nw-mut); }
.nw-table .num { text-align: right; font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.nw-table button { border: 0; border-radius: 6px; padding: 3px 10px; background: var(--nw-win); box-shadow: 0 0 0 1px var(--nw-line); font-size: 12px; cursor: pointer; }
.nw-grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.nw-log { display: grid; }
.nw-ev { display: grid; grid-template-columns: 70px 3px 1fr auto 24px; gap: 10px; align-items: center; padding: 7px 4px; border-radius: 8px; cursor: pointer; border: 0; background: none; text-align: left; width: 100%; }
.nw-ev:hover, .nw-ev.on { background: var(--nw-sel); }
.nw-ev time { font-family: var(--font-mono); font-size: 11.5px; color: var(--nw-mut); text-align: right; }
.nw-ev .bar { align-self: stretch; border-radius: 2px; background: var(--c); }
.nw-ev b { font-size: 13px; font-weight: 600; display: block; }
.nw-ev small { font-size: 11.5px; color: var(--nw-mut); overflow-wrap: anywhere; }
.nw-ev .d { font-family: var(--font-mono); font-size: 11px; color: var(--nw-mut); }
.nw-ev .raw { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: var(--nw-mut); font-size: 13px; }
.nw-ev .raw:hover { background: var(--nw-sel); color: var(--nw-ink); }
.nw-rawline { grid-column: 3 / -1; font-family: var(--font-mono); font-size: 10.5px; color: var(--nw-mut); background: var(--nw-win); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.nw-energy div { display: grid; grid-template-columns: 1fr 70px 52px; gap: 8px; align-items: center; padding: 6px 0; font-size: 13px; }
.nw-energy i { height: 2px; background: color-mix(in srgb, var(--nw-ink) 35%, transparent); justify-self: end; }
.nw-energy span { font-family: var(--font-mono); font-size: 12px; text-align: right; }
.nw-energy p { font-size: 11.5px; color: var(--nw-mut); margin: 8px 0 0; }

/* History actogram */
.nw-acto { display: grid; grid-template-columns: 110px 1fr 46px 42px 48px 36px; gap: 6px 10px; align-items: center; font-size: 12px; }
.nw-acto .h { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--nw-mut); }
.nw-acto .row { display: contents; cursor: pointer; }
.nw-acto .row > * { padding: 3px 0; }
.nw-acto .d { font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }
.nw-acto .strip { display: flex; height: 22px; border-radius: 3px; overflow: hidden; }
.nw-acto .strip i { height: 100%; }
.nw-acto .v { font-family: var(--font-mono); text-align: right; }
.nw-acto .v.red { color: var(--nw-red); }
.nw-acto button.row-btn { all: unset; display: contents; cursor: pointer; }
.nw-acto .rowwrap { display: contents; }
.nw-acto .rowwrap:hover > *, .nw-acto .rowwrap:focus-within > * { background: var(--nw-sel); }
.nw-acto .rowwrap > *:first-child { border-radius: 6px 0 0 6px; padding-left: 6px; }
.nw-acto .rowwrap > *:last-child { border-radius: 0 6px 6px 0; padding-right: 6px; }
.nw-trend { margin-left: auto; text-align: right; font-family: var(--font-mono); font-size: 10px; color: var(--nw-mut); letter-spacing: .06em; }
.nw-trend svg { display: block; width: 170px; height: 34px; }

/* Battery */
.nw-batgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nw-batgrid .nw-card { margin: 0; }
.nw-batgrid b { display: block; font-family: var(--font-mono); font-size: 20px; }
.nw-batgrid small { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--nw-mut); }
.nw-cost { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.nw-cost div { flex: 1; display: grid; justify-items: center; gap: 4px; font-family: var(--font-mono); font-size: 10px; color: var(--nw-mut); }
.nw-cost i { width: 100%; max-width: 36px; border-radius: 4px 4px 0 0; background: var(--s-asleep); }

/* "How it works" translation rows on the page */
.nw-translate { display: grid; gap: 10px; }
.nw-translate div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.nw-translate code { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.nw-translate i { font-style: normal; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }

@media (max-width: 760px) {
  .nw { height: auto; grid-template-rows: auto auto; }
  .nw-top { grid-template-columns: auto 1fr auto; }
  .nw-body { grid-template-columns: 1fr; }
  .nw-side { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--nw-line); padding: 8px; gap: 4px; }
  .nw-side .sec, .nw-samp, .nw-nav[data-view="settings"] { display: none; }
  .nw-nav { width: auto; }
  .nw-main { padding: 16px 14px; overflow: visible; }
  .nw-sum { font-size: 15px; }
  .nw-stats { gap: 16px; }
  .nw-rest { margin-left: 0; text-align: left; width: 100%; }
  .nw-rest .ticks { justify-content: flex-start; }
  .nw-grid2 { grid-template-columns: 1fr; }
  .nw-energy-card, .nw-kept .why { display: none; }
  .nw-acto { grid-template-columns: 74px 1fr 40px 30px; }
  .nw-acto .x { display: none; }
  .nw-batgrid { grid-template-columns: 1fr 1fr; }
  .nw-ev { grid-template-columns: 60px 3px 1fr auto; }
  .nw-ev .raw { display: none; }
  .nw-translate div { grid-template-columns: 1fr; gap: 4px; }
  .nw-translate i { justify-self: start; }
  .nw-trend { display: none; }
}
