/* The Moonical widgets (/widget/...): small pages that other websites show in an iframe.
   This is all the CSS they get; it does not use site.css. Two looks: light (default) and night.

   Every part has a fixed height, so that a widget is as high as its embed code says: see
   WidgetSizes.java, which adds the same numbers up. Change one, change both. */
html, body { margin: 0; padding: 0; background: transparent; }

.mw {
  --mw-bg: #fff; --mw-fg: #1c2541; --mw-text: #3a4160; --mw-muted: #5c627a; --mw-rule: #e3e0d6;
  --mw-head: #153d80; --mw-head-fg: #f7f4ec; --mw-head-muted: rgb(247 244 236 / 0.8);
  --mw-link: #153d80; --mw-soft: #f3f1e9; --mw-good: #ffce3e; --mw-good-fg: #1c2541; --mw-moon-dark: #3a61a8;
  box-sizing: border-box; width: 300px; max-width: 100%; border: 1px solid var(--mw-rule); border-radius: 12px;
  background: var(--mw-bg); color: var(--mw-fg); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: left; overflow: hidden;
}
.mw--night {
  --mw-bg: #162f66; --mw-fg: #f7f4ec; --mw-text: rgb(247 244 236 / 0.86); --mw-muted: rgb(247 244 236 / 0.72); --mw-rule: rgb(247 244 236 / 0.18);
  --mw-head: #0e2250; --mw-link: #ffce3e; --mw-soft: rgb(247 244 236 / 0.1); --mw-moon-dark: #3a61a8;
  border-color: #0e2250;
}
.mw *, .mw *::before { box-sizing: border-box; margin: 0; padding: 0; }
.mw a { color: inherit; text-decoration: none; }
a.mw { display: flex; color: var(--mw-fg); text-decoration: none; }
a.mw:hover { border-color: var(--mw-link); }
.mw a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.mw a:focus-visible { outline: 2px solid var(--mw-link); outline-offset: 2px; border-radius: 4px; }
a.mw:focus-visible { outline-offset: 1px; border-radius: 999px; }
.mw ul { list-style: none; }
.mw img { display: block; flex: none; width: 24px; height: 24px; }

/* Header: the moon or the activity, a title and one or two lines below it */
.mw-head { display: flex; align-items: center; gap: 10px; height: 62px; padding: 0 12px; background: var(--mw-head); color: var(--mw-head-fg); }
.mw-head > div:not(.mw-links) { flex: 1; min-width: 0; }
.mw-head svg { flex: none; width: 34px; height: 34px; }
.mw-head img { width: 34px; height: 34px; padding: 4px; border-radius: 8px; background: #fff; }
.mw-moon-dark { fill: var(--mw-moon-dark); }
.mw-moon-lit { fill: #ffce3e; }
.mw-title { overflow: hidden; font-size: 15px; font-weight: 700; line-height: 19px; text-overflow: ellipsis; white-space: nowrap; }
.mw-sub { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--mw-head-muted); font-size: 12.5px; line-height: 16px; }

/* Lists of activities: every row is 36 px, the list is as high as its rows */
.mw-label { height: 26px; padding: 8px 12px 0; color: var(--mw-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; line-height: 18px; text-transform: uppercase; }
.mw-list { height: calc(var(--rows, 5) * 36px + 8px); padding: 4px 12px; overflow: hidden; }
.mw-list li { display: flex; align-items: center; gap: 9px; height: 36px; font-weight: 600; }
.mw-list li + li { border-top: 1px solid var(--mw-rule); }
.mw-list a { display: -webkit-box; flex: 1; min-width: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.2; }
.mw-when { margin-left: auto; color: var(--mw-muted); font-size: 12.5px; font-weight: 400; white-space: nowrap; }
.mw-now { padding: 1px 8px; border-radius: 999px; background: var(--mw-good); color: var(--mw-good-fg); font-size: 12px; font-weight: 700; white-space: nowrap; }
.mw-more { height: 22px; padding: 0 12px; color: var(--mw-muted); font-size: 12.5px; line-height: 22px; }
.mw-empty { padding-top: 8px; color: var(--mw-text); }

/* Footer: the way back to Moonical */
.mw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 32px; padding: 0 12px; border-top: 1px solid var(--mw-rule); background: var(--mw-soft); font-size: 12.5px; }
.mw-foot svg, .mw-links svg { display: block; width: auto; height: 13px; color: var(--mw-link); }
.mw-foot a:last-child, .mw-links a:last-child { color: var(--mw-link); font-weight: 600; white-space: nowrap; }

/* One activity: the next good day and a small month of six weeks */
.mw-next { height: 74px; padding: 10px 12px 0; }
.mw-next small { display: block; color: var(--mw-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; line-height: 14px; text-transform: uppercase; }
.mw-next strong { display: block; overflow: hidden; font-size: 20px; letter-spacing: -0.01em; line-height: 25px; text-overflow: ellipsis; white-space: nowrap; }
.mw-next span { display: block; overflow: hidden; color: var(--mw-text); font-size: 12.5px; line-height: 17px; text-overflow: ellipsis; white-space: nowrap; }
.mw-cal { height: 190px; padding: 4px 12px 0; }
.mw-month { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
.mw-month caption { height: 18px; color: var(--mw-muted); font-size: 11.5px; font-weight: 600; line-height: 18px; text-align: left; }
.mw-month th { height: 16px; color: var(--mw-muted); font-size: 10.5px; font-weight: 600; line-height: 16px; }
.mw-month td { height: 24px; padding: 1px; }
.mw-month td span { display: grid; place-items: center; height: 22px; border-radius: 6px; }
.mw-month .good { background: var(--mw-good); color: var(--mw-good-fg); font-weight: 700; }
.mw-month .today { box-shadow: inset 0 0 0 1.5px currentColor; }
.mw-month .past { opacity: 0.45; }

/* Strip: head and links in one row, below it as many activities as fit in one line */
.mw--strip { width: 100%; }
.mw--strip .mw-head { height: 56px; }
.mw--strip .mw-sub { -webkit-line-clamp: 1; }
.mw-head .mw-links a, .mw-head .mw-links svg { color: var(--mw-head-fg); }
.mw-links { display: flex; flex: none; align-items: center; gap: 14px; font-size: 12.5px; }
.mw--strip .mw-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 0 18px; height: 38px; padding: 0 12px; border-top: 1px solid var(--mw-rule); }
.mw--strip .mw-list li { height: 37px; border: 0; }
.mw--strip .mw-list a { display: block; flex: none; max-width: 100%; white-space: nowrap; }

/* Badge: a single line */
.mw--badge { align-items: center; gap: 9px; width: 100%; padding: 0 12px 0 10px; border-radius: 999px; }
.mw--badge span { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mw--badge b { padding: 1px 8px; border-radius: 999px; background: var(--mw-good); color: var(--mw-good-fg); font-size: 13px; white-space: nowrap; }
.mw--badge svg { flex: none; width: auto; height: 11px; color: var(--mw-link); }

/* An address that is not a widget */
.mw--missing { padding: 12px; }
.mw--missing p { margin-bottom: 6px; }
.mw--missing a { color: var(--mw-link); font-weight: 600; }

@media (max-width: 440px) {
  .mw-links svg { display: none; }
}
@media (max-width: 320px) {
  .mw--badge svg { display: none; }
}
