/* Note content. Shared by screen previews and print; real mm / pt units,
   everything inside scales with the font size (em). */

.nb {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--paper, #fff);
}

.nb-glue {
  position: absolute;
  inset: 0 0 auto;
  height: min(11mm, 22%);
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.055), rgb(0 0 0 / 0.012));
  pointer-events: none;
}

.nc {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.38;
  overflow-wrap: anywhere;
  text-align: left;
  font-kerning: normal;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.nc *,
.nc *::before,
.nc *::after {
  box-sizing: border-box;
}

.nc .n-title {
  flex: none;
  overflow: hidden;
  margin-bottom: 0.42em;
  font-size: 1.12em;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.nc .n-title small {
  font-size: 0.7em;
  font-weight: 400;
  opacity: 0.6;
}

.nc .box {
  flex: none;
  width: 0.8em;
  height: 0.8em;
  border: 0.09em solid currentColor;
  border-radius: 0.14em;
}

/* text ---------------------------------------------------------------- */
.k-text.v-mid { justify-content: center; }

.k-text .t-img {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  max-height: 55%;
  margin: 0 0 0.45em;
  object-fit: contain;
}

.k-text.img-only .t-img {
  height: 100%;
  max-height: 100%;
  margin: 0;
}

.k-text .t-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  white-space: pre-wrap;
}

.k-text .t-body.is-ph { color: #9d9f9a; }

/* todo ---------------------------------------------------------------- */
.k-todo .td {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.k-todo .td-row {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 0.5em;
  min-height: 1.55em;
  max-height: 2.3em;
  border-bottom: 0.05em solid color-mix(in srgb, currentColor 32%, transparent);
}

.k-todo .td-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* month --------------------------------------------------------------- */
.k-month .m-head {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 0.45em;
  margin-bottom: 0.45em;
  line-height: 1;
}

.k-month .m-num {
  font-size: 2.35em;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.78;
  font-variant-numeric: tabular-nums;
}

.k-month .m-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  font-size: 0.7em;
}

.k-month .m-year { font-weight: 700; }
.k-month .m-name { opacity: 0.6; letter-spacing: 0.05em; white-space: nowrap; }

.k-month .m-note {
  max-width: 48%;
  margin-left: auto;
  overflow: hidden;
  font-size: 0.8em;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.k-month .m-grid {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-height: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.k-month .m-dow {
  margin-bottom: 0.25em;
  padding-bottom: 0.3em;
  border-bottom: 0.06em solid color-mix(in srgb, currentColor 40%, transparent);
  font-size: 0.68em;
  text-align: center;
  opacity: 0.7;
}

.k-month .m-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}

.k-month .m-day i {
  position: relative;
  font-size: 0.95em;
  font-style: normal;
  line-height: 1;
}

.k-month .is-we { opacity: 0.55; }
.k-month .m-dow.is-we { opacity: 0.45; }

.k-month .m-day.is-mark { opacity: 1; }

.k-month .m-day.is-mark i::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.62em;
  height: 1.62em;
  border: 0.09em solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

/* week ---------------------------------------------------------------- */
.k-week .wk {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.k-week .wk-row {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 0.45em;
  min-height: 1.3em;
  overflow: hidden;
  border-top: 0.05em solid color-mix(in srgb, currentColor 32%, transparent);
}

.k-week .wk-d {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 0.22em;
  width: 1.2em;
}

.k-week .has-date .wk-d { width: 2.35em; }
.k-week .wk-d b { font-weight: 700; }
.k-week .wk-d small { font-size: 0.78em; opacity: 0.55; font-variant-numeric: tabular-nums; }
.k-week .is-we .wk-d b { opacity: 0.6; }

.k-week .wk-t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.is-strip.k-week .wk { flex-direction: row; }

.is-strip.k-week .wk-row {
  flex-direction: column;
  align-items: stretch;
  gap: 0.1em;
  padding: 0 0.25em;
  border-top: 0;
  border-left: 0.05em solid color-mix(in srgb, currentColor 32%, transparent);
}

.is-strip.k-week .wk-row:first-child { padding-left: 0; border-left: 0; }
.is-strip.k-week .wk-d { width: auto; }
.is-strip.k-week .wk-t { white-space: normal; font-size: 0.85em; }

/* habit --------------------------------------------------------------- */
.k-habit .hb {
  display: grid;
  flex: 1 1 auto;
  grid-auto-rows: minmax(1.6em, 2.3em);
  align-content: start;
  row-gap: 0.1em;
  min-height: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.k-habit .hb-n {
  align-self: end;
  padding-bottom: 0.25em;
  font-size: 0.62em;
  text-align: center;
  opacity: 0.6;
}

.k-habit .hb-name {
  align-self: center;
  overflow: hidden;
  padding-right: 0.35em;
  font-size: 0.86em;
  font-weight: 600;
  white-space: nowrap;
}

.k-habit .hb-cell {
  display: grid;
  place-items: center;
  min-width: 0;
}

.k-habit .hb .box {
  width: min(0.9em, 84%);
  height: auto;
  aspect-ratio: 1;
}

/* paper --------------------------------------------------------------- */
.k-paper .pp {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.k-paper .pp-art {
  position: absolute;
  top: 0;
  left: 0;
  overflow: visible;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.16;
  opacity: 0.4;
}

.k-paper .pp-art circle { stroke: none; }

.k-paper .pp-t {
  position: relative;
  white-space: pre-wrap;
}

/* class --------------------------------------------------------------- */
.k-class .c-top {
  display: flex;
  flex: none;
  gap: 0.55em;
  margin-bottom: 0.5em;
  padding-bottom: 0.4em;
  overflow: hidden;
  border-bottom: 0.07em solid currentColor;
  font-size: 0.8em;
  white-space: nowrap;
}

.k-class .c-top span + span::before {
  margin-right: 0.55em;
  content: "·";
  opacity: 0.5;
}

.k-class .c-sub {
  flex: none;
  margin-bottom: 0.3em;
  overflow: hidden;
  font-size: 1.9em;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.k-class .c-note {
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  font-size: 0.92em;
  white-space: pre-wrap;
}

.is-strip.k-class {
  flex-flow: row wrap;
  align-content: center;
  align-items: baseline;
  column-gap: 0.6em;
}

.is-strip.k-class .c-top { order: 2; margin: 0; padding: 0; border: 0; }
.is-strip.k-class .c-sub { margin: 0; font-size: 1.3em; }
.is-strip.k-class .c-note { flex-basis: 100%; }
