/* =====================================================================
   OwlDiary — Obsidian-inspired UI
   Themes: dark (黑) · light (白) · wood (木)
   ===================================================================== */

:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f6f6f6;
  --panel: #f2f2f2;
  --hover: rgba(0, 0, 0, 0.05);
  --text: #222222;
  --muted: #5c5c5c;
  --faint: #ababab;
  --line: #e3e3e3;
  --line-strong: #d0d0d0;
  --accent: #7b5cf0;
  --accent-text: #ffffff;
  --accent-soft: rgba(123, 92, 240, 0.12);
  --tag-text: #6a4fe0;
  --sidebar: #f6f6f6;
  --chrome: rgba(242, 242, 242, 0.86);
  --c-course: #2f7cf6;
  --c-exam: #e93147;
  --c-lab: #08a84a;
  --c-general: #7b5cf0;
  --c-cyan: #00a6a3;
  --warn: #e07b00;
  --danger: #e93147;
  --ok: #08a84a;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --bg-2: #161616;
  --panel: #1c1c1c;
  --hover: rgba(255, 255, 255, 0.06);
  --text: #dadada;
  --muted: #a3a3a3;
  --faint: #666666;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --accent: #8b6cef;
  --accent-text: #ffffff;
  --accent-soft: rgba(139, 108, 239, 0.2);
  --tag-text: #b9a5ff;
  --sidebar: #1e1e1e;
  --chrome: rgba(38, 38, 38, 0.82);
  --c-course: #4d93ff;
  --c-exam: #fb464c;
  --c-lab: #44cf6e;
  --c-general: #a88bfa;
  --c-cyan: #53dfdd;
  --warn: #e9973f;
  --danger: #fb464c;
  --ok: #44cf6e;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

:root[data-theme='wood'] {
  color-scheme: light;
  --bg: #f7f1e7;
  --bg-2: #efe6d6;
  --panel: #ebe0cd;
  --hover: rgba(90, 55, 25, 0.07);
  --text: #3b2a1b;
  --muted: #7a6249;
  --faint: #b5a083;
  --line: #e0d2bb;
  --line-strong: #cdb99a;
  --accent: #9a5f2c;
  --accent-text: #fff8ee;
  --accent-soft: rgba(154, 95, 44, 0.14);
  --tag-text: #8a5224;
  --sidebar: #ebe0cd;
  --chrome: rgba(235, 224, 205, 0.88);
  --c-course: #3f6f9e;
  --c-exam: #b8462c;
  --c-lab: #5b8a37;
  --c-general: #9a5f2c;
  --c-cyan: #2f8a86;
  --warn: #c27712;
  --danger: #b8462c;
  --ok: #5b8a37;
  --shadow: 0 10px 30px rgba(70, 40, 15, 0.16);
}

/* ---------- base ---------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: var(--accent);
  text-decoration: none;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}
[hidden] {
  display: none !important;
}
.ic {
  width: 18px;
  height: 18px;
  flex: none;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.small {
  font-size: 13.5px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- app layout ---------- */
.app {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 12px;
  z-index: 40;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
}
.nav a,
.nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.nav a .ic {
  color: var(--muted);
}
.nav a:hover {
  background: var(--hover);
}
.nav a.active {
  background: var(--hover);
  font-weight: 600;
}
.nav a.active .ic {
  color: var(--accent);
}
.nav .count {
  margin-left: auto;
  font-size: 12px;
  line-height: 18px;
  min-width: 18px;
  text-align: center;
  border-radius: 99px;
  padding: 0 6px;
  color: #fff;
  background: var(--danger);
}
.nav-group {
  font-size: 12px;
  color: var(--faint);
  padding: 14px 12px 4px;
  letter-spacing: 0.5px;
}
.sidebar .spacer {
  flex: 1;
}
.vault {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px 2px 12px;
  border-top: 1px solid var(--line);
}
.vault img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.vault b {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}
.vault span {
  font-size: 12.5px;
  color: var(--muted);
}
.sync-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 5px;
  vertical-align: 1px;
}
.sync-dot.on {
  background: var(--ok);
  color: var(--ok);
  animation: pulse 2.4s infinite;
}

main {
  min-width: 0;
  padding: 40px 32px 80px;
}
.page {
  max-width: 760px;
  margin: 0 auto;
  animation: pageIn 0.22s ease;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* mobile chrome: round buttons on top, drawer, floating bottom bar */
.topbar,
.bottombar,
.scrim {
  display: none;
}
.round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--chrome);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
}
.round .ic,
.pill-group .ic {
  width: 22px;
  height: 22px;
}
.pill-group {
  display: flex;
  border-radius: 99px;
  background: var(--chrome);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0 4px;
}
.pill-group button,
.pill-group a {
  width: 46px;
  height: 46px;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: auto;
    width: min(84vw, 330px);
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    border-right: 0;
  }
  .drawer-open .sidebar {
    transform: none;
    box-shadow: var(--shadow);
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .drawer-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    top: 0;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    pointer-events: none;
  }
  .topbar > * {
    pointer-events: auto;
  }
  .bottombar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    z-index: 30;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(92vw, 420px);
    height: 58px;
    border-radius: 99px;
    background: var(--chrome);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  }
  .bottombar a,
  .bottombar button {
    flex: 1;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 0;
    background: none;
    position: relative;
    cursor: pointer;
  }
  .bottombar .ic {
    width: 24px;
    height: 24px;
  }
  .bottombar a.active {
    color: var(--accent);
  }
  .bottombar .count {
    position: absolute;
    top: 9px;
    left: 56%;
    min-width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--danger);
    font-size: 0;
  }
  main {
    padding: calc(76px + env(safe-area-inset-top)) 18px calc(100px + env(safe-area-inset-bottom));
  }
}

/* ---------- note-style headings ---------- */
.title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}
.subtitle {
  color: var(--muted);
  margin-bottom: 22px;
}
.head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 700;
  margin: 30px 0 10px;
}
.h2 .count {
  font-size: 14px;
  font-weight: 500;
  color: var(--faint);
}
.h2 .right {
  margin-left: auto;
  font-size: 14px;
  font-weight: 400;
}
details.fold > summary {
  list-style: none;
  cursor: pointer;
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold > summary .chev {
  display: inline-flex;
  color: var(--faint);
  transition: transform 0.2s;
}
details.fold[open] > summary .chev {
  transform: rotate(90deg);
}
.empty {
  color: var(--faint);
  padding: 14px 4px;
  font-size: 15px;
}
.hint {
  font-size: 13px;
  color: var(--faint);
  margin-top: 6px;
}

/* ---------- properties panel ---------- */
.props-label {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 8px 2px;
}
.props {
  background: var(--panel);
  border-radius: 22px;
  padding: 10px 6px;
  margin-bottom: 20px;
}
.prop {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 14px;
  border-radius: 12px;
}
.prop[data-act] {
  cursor: pointer;
}
.prop[data-act]:hover {
  background: var(--hover);
}
.prop .k {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 124px;
  flex: none;
  color: var(--muted);
}
.prop .k .ic {
  width: 19px;
  height: 19px;
}
.prop .v {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}
@media (max-width: 420px) {
  .prop .k {
    width: 96px;
  }
}

.pbar {
  flex: 1;
  min-width: 80px;
  max-width: 220px;
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.pbar i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.6s cubic-bezier(0.3, 1.3, 0.5, 1);
  overflow: hidden;
}
.pbar.full i {
  background: var(--ok);
}
.pbar.full i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shine 1.6s ease-in-out infinite;
}
@keyframes shine {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* ---------- callouts ---------- */
.callout {
  --c: var(--accent);
  background: color-mix(in srgb, var(--c) 9%, transparent);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c);
  font-weight: 700;
  margin-bottom: 6px;
}
.callout-title .ic {
  width: 20px;
  height: 20px;
}
.callout-title .right {
  margin-left: auto;
  font-weight: 400;
}
.callout.c-danger {
  --c: var(--danger);
}
.callout.c-warn {
  --c: var(--warn);
}
.callout.c-ok {
  --c: var(--ok);
}
.callout.c-cyan {
  --c: var(--c-cyan);
}
.callout.c-note {
  --c: var(--c-course);
}
.callout .tasks {
  margin: 0 -10px;
}

/* ---------- tags / chips ---------- */
.tag {
  --c: var(--c-general);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 99px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  white-space: nowrap;
}
.tag .ic {
  width: 13px;
  height: 13px;
}
.k-course {
  --c: var(--c-course);
}
.k-exam {
  --c: var(--c-exam);
}
.k-lab {
  --c: var(--c-lab);
}
.k-general {
  --c: var(--c-general);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 99px;
  padding: 6px 13px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  background: var(--panel);
  border: 1px solid transparent;
  color: var(--text);
}
.chip input {
  display: none;
}
.chip .ic {
  width: 16px;
  height: 16px;
}
.chip:has(input:checked),
.chip.on {
  background: var(--accent-soft);
  color: var(--tag-text);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  background: var(--panel);
  color: var(--text);
  transition: transform 0.1s, filter 0.15s, background 0.15s;
}
.btn:hover {
  filter: brightness(0.97);
}
:root[data-theme='dark'] .btn:hover {
  filter: brightness(1.2);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  color: var(--danger);
}
.btn.sm {
  padding: 6px 11px;
  font-size: 13.5px;
  border-radius: 8px;
}
.btn[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
.btn .ic {
  width: 17px;
  height: 17px;
}
.icon-btn {
  border: 0;
  background: transparent;
  padding: 7px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.input,
select.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.input {
  resize: vertical;
  min-height: 84px;
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field > span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: none;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background 0.2s;
  cursor: pointer;
}
.switch i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.switch input:checked + i {
  background: var(--accent);
}
.switch input:checked + i::after {
  transform: translateX(18px);
}

/* ---------- quick add ---------- */
.quick {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  border: 1px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.quick:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.quick input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  padding: 9px 0;
}
.quick .icon-btn .ic {
  width: 20px;
  height: 20px;
}

/* ---------- task list (Obsidian checklists) ---------- */
.tasks {
  list-style: none;
  margin: 0 -8px;
  padding: 0;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  transition: opacity 0.35s, background 0.15s;
}
.task:hover {
  background: var(--hover);
}
.task .body {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.task .title-t {
  word-break: break-word;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 56% / 0 1.5px;
  transition: background-size 0.35s ease, color 0.3s;
}
.task .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}
.task.done .title-t,
.task.checking .title-t {
  background-size: 100% 1.5px;
  color: var(--faint);
}
.task.done .meta {
  opacity: 0.6;
}
.task.done .tag {
  filter: grayscale(1);
}

.check {
  --c: var(--accent);
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 3px;
  border-radius: 5px;
  border: 1.6px solid var(--faint);
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: border-color 0.15s, background 0.2s, transform 0.15s;
}
.check:hover {
  border-color: var(--c);
}
.check .ic {
  width: 14px;
  height: 14px;
  stroke: var(--accent-text);
  stroke-width: 3.2;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.28s 0.06s ease;
}
.done .check,
.checking .check {
  background: var(--c);
  border-color: var(--c);
}
.done .check .ic,
.checking .check .ic {
  stroke-dashoffset: 0;
}
.checking .check {
  animation: checkPop 0.38s ease;
}
.checking .check::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  border: 2px solid var(--c);
  animation: ripple 0.6s ease-out forwards;
}
@keyframes checkPop {
  50% {
    transform: scale(1.22);
  }
}
@keyframes ripple {
  from {
    opacity: 0.8;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(2.2);
  }
}

/* deadline pill with a live clock */
.due {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px 3px 7px;
  border-radius: 99px;
  background: var(--panel);
  color: var(--text);
}
.due .ic {
  width: 14px;
  height: 14px;
}
.due .hand-m,
.due .hand-h {
  transform-origin: 12px 12px;
}
.due.soon {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
}
.due.soon .hand-m {
  animation: spin 2s linear infinite;
}
.due.soon .hand-h {
  animation: spin 24s linear infinite;
}
.due.over {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}
.due.over::before,
.dot-live {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.4s infinite;
  flex: none;
}
.due.over .ic {
  display: none;
}
.due.ok {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 13%, transparent);
}
.early {
  color: var(--ok);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---------- today: classes timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.timeline li {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.timeline .time {
  width: 46px;
  flex: none;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  line-height: 1.4;
  padding-top: 8px;
}
.timeline .time b {
  display: block;
  color: var(--text);
  font-weight: 600;
}
.timeline .info {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 10%, transparent);
  border-left: 3px solid var(--c);
  position: relative;
  overflow: hidden;
}
.timeline .info .name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeline .info .sub-i {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.timeline li.past {
  opacity: 0.42;
}
.timeline .elapsed {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: var(--c);
}
.timeline li.now .name .dot-live {
  color: var(--c);
}

/* ---------- habit pills ---------- */
.habit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.habit-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px 7px 10px;
  border-radius: 99px;
  border: 0;
  background: var(--panel);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.habit-chip .ic,
.habit-chip .glyph {
  width: 17px;
  height: 17px;
  font-size: 14px;
  line-height: 17px;
  text-align: center;
}
.habit-chip.on {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}

/* ---------- calendar ---------- */
.cal-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.cal-head h3 {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}
.cal .dow {
  text-align: center;
  font-size: 12px;
  color: var(--faint);
  padding: 4px 0 6px;
}
.cal .day {
  height: 50px;
  border: 0;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 5px 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  border-radius: 10px;
}
.cal .day:hover {
  background: var(--hover);
}
.cal .day .num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.cal .day.other {
  color: var(--faint);
}
.cal .day.today .num {
  color: var(--accent);
  font-weight: 700;
}
.cal .day.sel .num {
  background: var(--accent);
  color: var(--accent-text);
}
.cal .dots {
  display: flex;
  gap: 3px;
  height: 5px;
}
.cal .dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c);
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  margin-right: 6px;
}
.panel {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
:root[data-theme='dark'] .panel {
  background: var(--panel);
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 110px;
  padding-top: 8px;
}
.bars .b {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  font-size: 11.5px;
  color: var(--muted);
}
.bars .b i {
  display: block;
  width: 100%;
  max-width: 30px;
  border-radius: 6px 6px 3px 3px;
  background: var(--accent);
  min-height: 4px;
  transform-origin: bottom;
  animation: grow 0.6s cubic-bezier(0.3, 1.3, 0.5, 1) both;
}
.bars .b:nth-child(2) i {
  animation-delay: 0.04s;
}
.bars .b:nth-child(3) i {
  animation-delay: 0.08s;
}
.bars .b:nth-child(4) i {
  animation-delay: 0.12s;
}
.bars .b:nth-child(5) i {
  animation-delay: 0.16s;
}
.bars .b:nth-child(6) i {
  animation-delay: 0.2s;
}
.bars .b:nth-child(7) i {
  animation-delay: 0.24s;
}
.bars .b i.zero {
  background: var(--line);
}
.bars .b.today i {
  background: var(--ok);
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

/* ---------- timetable ---------- */
.tt-wrap {
  overflow-x: auto;
}
.tt {
  --hour: 54px;
  display: grid;
  grid-template-columns: 42px repeat(7, minmax(0, 1fr));
  min-width: 320px;
  position: relative;
}
.tt .th {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  padding: 6px 0 8px;
  line-height: 1.3;
}
.tt .th small {
  color: var(--faint);
}
.tt .th.today,
.tt .th.today small {
  color: var(--accent);
  font-weight: 700;
}
.tt .hours,
.tt .col {
  position: relative;
}
.tt .hours div {
  height: var(--hour);
  font-size: 11px;
  color: var(--faint);
  text-align: right;
  padding-right: 6px;
  transform: translateY(-7px);
}
.tt .col {
  border-left: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% var(--hour);
}
.tt .col.today {
  background-color: color-mix(in srgb, var(--accent) 5%, transparent);
}
.tt .col.pmode {
  background-image: none;
}
.tt .col .band {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed var(--line);
}
.tt .hours.periods div {
  position: absolute;
  left: 0;
  right: 0;
  transform: none;
  padding: 3px 6px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  height: auto;
  border-top: 1px dashed var(--line);
}
.tt .hours.periods b {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}
.tt .hours.periods span {
  font-size: 9.5px;
  color: var(--faint);
}
.tt .ev {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 6px;
  padding: 4px 5px 4px 6px;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 16%, var(--bg));
  border-left: 3px solid var(--c);
  transition: transform 0.15s;
}
.tt .ev:hover {
  transform: scale(1.02);
}
.tt .ev b {
  display: block;
  font-weight: 600;
  word-break: break-all;
}
.tt .ev .loc {
  opacity: 0.8;
}
.tt .nowline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 2;
}
.tt .nowline::before {
  content: '';
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--danger);
  animation: pulse 1.6s infinite;
}
@media (max-width: 560px) {
  .tt {
    --hour: 48px;
    grid-template-columns: 30px repeat(7, minmax(0, 1fr));
  }
  .tt .ev {
    font-size: 10.5px;
    padding: 3px 2px 3px 4px;
    border-left-width: 2px;
  }
  .tt .ev .loc {
    display: none;
  }
}
.setup-card {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.setup-card img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

/* ---------- habits page ---------- */
.habit {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
}
.habit:last-child {
  border-bottom: 0;
}
.habit .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--tag-text);
  flex: none;
  font-size: 20px;
}
.habit .icon .ic {
  width: 22px;
  height: 22px;
}
.streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  color: var(--warn);
}
.streak .ic {
  width: 14px;
  height: 14px;
}
.hdots {
  display: flex;
  gap: 4px;
  margin-top: 7px;
}
.hdots button {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--line);
  transition: background 0.2s, transform 0.15s;
}
.hdots button:hover {
  transform: scale(1.2);
}
.hdots button.on {
  background: var(--ok);
}
.hdots button.rest {
  background: transparent;
  outline: 1px dashed var(--line-strong);
}
.hdots button.today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.big-check {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.6px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: none;
  transition: all 0.2s;
  color: var(--faint);
}
.big-check .ic {
  width: 22px;
  height: 22px;
  stroke-width: 2.6;
}
.big-check.on {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

/* ---------- goals ---------- */
.progress {
  height: 6px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.6s;
}
.milestones {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.milestones li {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
  font-size: 15px;
}
.milestones li.done .t {
  text-decoration: line-through;
  color: var(--faint);
}
.milestones input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.review {
  white-space: pre-wrap;
  line-height: 1.8;
}

/* ---------- settings (grouped list) ---------- */
.group-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin: 24px 0 10px 18px;
}
.group {
  background: var(--panel);
  border-radius: 22px;
  overflow: hidden;
  margin-bottom: 8px;
}
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px 0 18px;
  min-height: 58px;
  color: var(--text);
  position: relative;
}
a.item:hover,
button.item:hover {
  background: var(--hover);
}
button.item {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.item + .item::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 54px;
  border-top: 1px solid var(--line);
}
.group.flat .item + .item::before {
  left: 18px;
}
.item > .ic {
  width: 22px;
  height: 22px;
  color: var(--text);
}
.item .lbl {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
}
.item .lbl b {
  display: block;
  font-weight: 500;
}
.item .lbl span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 1px;
}
.item .chev-r {
  color: var(--faint);
}
.item .input {
  width: auto;
  max-width: 55%;
}
.item.danger,
.item.danger > .ic {
  color: var(--danger);
}
.item.stack {
  flex-wrap: wrap;
}
.item.stack > .full {
  flex-basis: 100%;
  padding-bottom: 14px;
}
.subhead {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -8px 0 6px -10px;
}
.form-pad {
  padding: 16px 18px 6px;
}
.status-pill {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--bg-2);
  color: var(--muted);
  white-space: nowrap;
}
.status-pill.ok {
  background: color-mix(in srgb, var(--ok) 15%, transparent);
  color: var(--ok);
}
.themes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}
.theme-card {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.theme-card:hover {
  transform: translateY(-2px);
}
.theme-card.on {
  border-color: var(--accent);
}
.theme-card .pv {
  height: 74px;
  display: grid;
  grid-template-columns: 30% 1fr;
}
.theme-card .pv i:first-child {
  border-right: 1px solid rgba(128, 128, 128, 0.2);
}
.theme-card .pv i:last-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
}
.theme-card .pv i:last-child::before,
.theme-card .pv i:last-child::after {
  content: '';
  height: 6px;
  border-radius: 3px;
  background: var(--pv-accent);
  width: 70%;
}
.theme-card .pv i:last-child::after {
  width: 45%;
  opacity: 0.4;
}
.theme-card span {
  display: block;
  padding: 7px;
  font-size: 13.5px;
  background: var(--panel);
}
.pv-light {
  --pv-accent: #7b5cf0;
  background: #fff;
}
.pv-light i:first-child {
  background: #f2f2f2;
}
.pv-dark {
  --pv-accent: #8b6cef;
  background: #0d0d0d;
}
.pv-dark i:first-child {
  background: #1e1e1e;
}
.pv-wood {
  --pv-accent: #9a5f2c;
  background: #f7f1e7;
}
.pv-wood i:first-child {
  background: #ebe0cd;
}

/* ---------- modal / sheet ---------- */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade 0.15s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--bg-2);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.24s cubic-bezier(0.2, 1.1, 0.4, 1);
}
:root[data-theme='dark'] .modal {
  background: #1e1e1e;
}
.modal.wide {
  max-width: 720px;
}
@keyframes rise {
  from {
    transform: translateY(18px) scale(0.98);
    opacity: 0;
  }
}
.modal h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal h2 .ic {
  color: var(--accent);
}
.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 18px;
  flex-wrap: wrap;
}
.modal .actions .left {
  margin-right: auto;
}
.modal .props {
  background: var(--bg);
}
:root[data-theme='dark'] .modal .props {
  background: #262626;
}
.modal .prop .input {
  background: transparent;
  border-color: transparent;
  padding: 6px 8px;
}
.modal .prop .input:focus {
  background: var(--bg-2);
  border-color: var(--accent);
}
.title-input {
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 24px;
  font-weight: 800;
  padding: 2px 0 12px;
}
@media (max-width: 560px) {
  .modal-bg {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: 24px 24px 0 0;
    max-height: 92vh;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
}
.preview-list {
  list-style: none;
  padding: 6px;
  margin: 0;
  max-height: 50vh;
  overflow: auto;
  background: var(--bg);
  border-radius: 14px;
}
:root[data-theme='dark'] .preview-list {
  background: #262626;
}
.preview-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14.5px;
}
.preview-list li:hover {
  background: var(--hover);
}
.preview-list input[type='checkbox'] {
  margin-top: 4px;
  accent-color: var(--accent);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0 8px;
}
.section-title .right {
  margin-left: auto;
  font-weight: 400;
}

/* ---------- notices (toasts) ---------- */
.toasts {
  position: fixed;
  z-index: 70;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 11px 12px 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  animation: toastIn 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
  width: 100%;
  position: relative;
  overflow: hidden;
}
:root[data-theme='dark'] .toast {
  background: #262626;
}
.toast::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  animation: drain var(--life, 3.2s) linear forwards;
}
.toast.alert {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.toast.alert::after {
  background: var(--danger);
}
.toast .msg {
  flex: 1;
  min-width: 0;
}
.toast .msg b {
  display: block;
}
.toast.alert .msg b {
  color: var(--danger);
}
.toast button {
  border: 0;
  background: var(--accent-soft);
  color: var(--tag-text);
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 600;
}
.toast.out {
  animation: toastOut 0.25s ease forwards;
}
@keyframes toastIn {
  from {
    transform: translateY(-14px) scale(0.97);
    opacity: 0;
  }
}
@keyframes toastOut {
  to {
    transform: translateY(-10px);
    opacity: 0;
  }
}
@keyframes drain {
  to {
    transform: scaleX(0);
  }
}
@media (max-width: 860px) {
  .toasts {
    right: 50%;
    transform: translateX(50%);
    top: calc(70px + env(safe-area-inset-top));
    align-items: center;
  }
}
.confetti {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ---------- auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.auth .box {
  width: 100%;
  max-width: 380px;
}
.auth .logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  text-align: center;
}
.auth .logo img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 8px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  50% {
    transform: translateY(-5px);
  }
}
.auth .logo h1 {
  font-size: 28px;
  font-weight: 800;
}
.auth .brand-cn {
  letter-spacing: 6px;
  color: var(--muted);
  font-size: 13px;
}
.auth .switch-mode {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.auth .switch-mode a {
  cursor: pointer;
}
.error {
  color: var(--danger);
  font-size: 13.5px;
  min-height: 18px;
  margin-bottom: 8px;
}

/* ---------- AI chat ---------- */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 40vh;
}
.msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: pageIn 0.2s ease;
}
.msg.me {
  justify-content: flex-end;
}
.msg .avatar {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
}
.msg .bubble {
  max-width: min(640px, 86%);
  line-height: 1.75;
  word-break: break-word;
}
.msg.me .bubble {
  background: var(--accent-soft);
  padding: 9px 14px;
  border-radius: 16px 16px 4px 16px;
}
.msg.bot .bubble {
  padding-top: 3px;
}
.msg .bubble code {
  font-size: 0.9em;
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 5px;
}
.acts {
  list-style: none;
  margin: 2px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c-cyan) 9%, transparent);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acts li {
  display: flex;
  gap: 9px;
  align-items: center;
  animation: slideIn 0.3s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.acts li .ic {
  width: 16px;
  height: 16px;
}
.acts .act-add .ic {
  color: var(--c-course);
}
.acts .act-done .ic {
  color: var(--ok);
}
.acts .act-edit .ic {
  color: var(--warn);
}
.acts .act-delete .ic {
  color: var(--danger);
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
}
.typing {
  display: inline-flex;
  gap: 5px;
  padding: 8px 0;
}
.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.typing i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
.chat-dock {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 22px;
  padding: 6px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.chat-dock textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  padding: 9px 6px;
  max-height: 160px;
  line-height: 1.5;
}
.chat-dock .btn {
  border-radius: 14px;
  padding: 10px 12px;
}
.chat-dock .mic.on {
  color: var(--danger);
  animation: blink 1.2s infinite;
}
@media (max-width: 860px) {
  .chat-dock {
    bottom: calc(82px + env(safe-area-inset-bottom));
  }
}

/* ---------- schedule setup wizard ---------- */
.steps {
  display: flex;
  gap: 6px;
  margin: -6px 0 16px;
  flex-wrap: wrap;
}
.steps span {
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 99px;
  background: var(--panel);
  color: var(--faint);
}
.steps span.on {
  background: var(--accent);
  color: var(--accent-text);
}
.steps span.past {
  color: var(--ok);
}
.grid-3 .row {
  gap: 6px;
}
.grid-3 .row span {
  white-space: nowrap;
}
.gen-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.gen-row b {
  width: 36px;
  font-weight: 600;
}
.gen-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.gen-row .input {
  width: auto;
}
.gen-row input[type='number'] {
  width: 64px;
}
.period-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  max-height: 46vh;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.period-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.period-list .pn {
  width: 54px;
  flex: none;
  font-size: 13.5px;
  color: var(--muted);
}
.period-list .input {
  flex: 1;
  min-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.btn.primary.bad {
  background: var(--danger);
  color: #fff;
}
.head-row {
  flex-wrap: wrap;
}
.head-row > .row {
  margin-top: 6px;
}
.due {
  white-space: nowrap;
}
.vault .grow > span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .modal .prop {
    flex-wrap: wrap;
    gap: 4px 12px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .modal .prop .k {
    width: 100%;
  }
  .modal .prop .v {
    padding-left: 29px;
  }
  .modal .prop .v .input[type='date'],
  .modal .prop .v select.input {
    width: auto;
    flex: 1;
  }
}
.code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
}
.item.dim {
  opacity: 0.55;
}
.item.invite .icon-btn {
  margin-left: -4px;
}
