@font-face {
  font-family: Manrope;
  src: url("assets/Manrope.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #f4f7fb;
  --muted: #9aabbb;
  --soft: #c5d4e2;
  --line: rgba(255, 255, 255, 0.1);
  --glass: linear-gradient(180deg, rgba(20, 30, 42, 0.72), rgba(10, 16, 24, 0.62));
  --glass-2: linear-gradient(180deg, rgba(28, 40, 54, 0.55), rgba(14, 22, 32, 0.5));
  --accent: #8fd4ff;
  --accent-2: #bfe6ff;
  --accent-soft: rgba(143, 212, 255, 0.16);
  --track: rgba(255, 255, 255, 0.12);
  --field: rgba(6, 12, 18, 0.45);
  --chip: rgba(8, 14, 20, 0.55);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --radius: 26px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --photo: url("assets/bg.jpg");
  --veil: linear-gradient(180deg, rgba(4, 10, 16, 0.28), rgba(4, 10, 16, 0.45));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; min-height: 0; }
body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #071018;
  overflow: hidden;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.bg {
  position: fixed;
  inset: 0;
  background-image: var(--veil), var(--photo);
  background-position: center, center;
  background-size: cover, cover;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: saturate(0.9) contrast(1.05);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 70% 40%, transparent 0%, rgba(4, 10, 16, 0.35) 70%, rgba(4, 10, 16, 0.55) 100%);
  pointer-events: none;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
}

/* login */
.login {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.login-card {
  width: min(440px, 100%);
  padding: 32px 32px 26px;
  animation: rise 0.7s var(--ease);
}
.login-card .logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-bottom: 10px;
}
.login-card .word {
  height: 28px;
  width: auto;
  display: block;
  margin: 0 0 8px;
}
.login-card .word.day { display: none; }
body.day .login-card .word.night { display: none; }
body.day .login-card .word.day { display: block; }
.login-card h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.login-card .sub {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
label.field { display: block; margin-bottom: 12px; }
label.field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
input.line, select.line, textarea.slip {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background-color: var(--field);
  color: var(--ink);
  font-size: 15px;
  outline: none;
}
input.line, select.line { height: 48px; padding: 0 14px; }
select.line {
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 12px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
input.line:focus, select.line:focus, textarea.slip:focus { border-color: var(--accent); }
input.line::placeholder { color: var(--muted); }
.btn {
  border: 0;
  height: 48px;
  border-radius: 999px;
  padding: 0 18px;
  background: linear-gradient(180deg, #d7f1ff, #7ec8f6);
  color: #102033;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(126, 200, 246, 0.25);
}
.btn.block { width: 100%; margin-top: 6px; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--line);
}
.login-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}
.linkish {
  background: none;
  border: 0;
  color: var(--accent-2);
  padding: 0;
  font-size: 14px;
  font-weight: 600;
}
.err { min-height: 18px; color: #ffb4a8; font-size: 13px; margin: 8px 0 0; }
.demo {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* shell */
.shell {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 16px 16px 14px;
}
.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 168px;
}
.brand .mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(143, 212, 255, 0.35);
}
.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}
.brand-copy .word {
  height: 20px;
  width: auto;
  display: block;
}
.brand-copy .word.day { display: none; }
body.day .brand-copy .word.night { display: none; }
body.day .brand-copy .word.day { display: block; }
.brand-copy small {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}
body.day .brand-copy small { text-shadow: 0 1px 8px rgba(255, 246, 240, 0.9); }
.search {
  flex: 1;
  min-width: 0;
  max-width: 560px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--chip);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  color: var(--ink);
}
.search input {
  flex: 1;
  background: none;
  border: 0;
  outline: none;
  font-size: 15px;
}
.search input::placeholder { color: #8ea0b2; }
.userchip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #eef7ff, #9fd4f8);
  color: #102033;
  font-weight: 800;
  font-size: 13px;
}
.userchip small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.userchip b, .userchip small {
  display: block;
  max-width: 168px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.userchip b { font-size: 14px; font-weight: 700; }
.theme {
  height: 42px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}
.theme i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft);
}
.theme-float { position: fixed; top: 18px; right: 18px; z-index: 4; }
.bell {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--ink);
  position: relative;
  flex: 0 0 auto;
}
.bell .dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.nav {
  width: 72px;
  align-self: start;
  margin-top: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  z-index: 6;
  transition: width 0.42s var(--ease);
}
.nav:hover, .nav.pinned { width: 228px; }
.nav button {
  height: 46px;
  border: 0;
  background: transparent;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--soft);
  padding: 0 12px;
  white-space: nowrap;
  position: relative;
}
.nav button svg { flex: 0 0 22px; }
.nav button span {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  font-size: 15px;
  font-weight: 650;
}
.nav:hover button span, .nav.pinned button span { opacity: 1; transform: none; }
.nav button.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.nav button .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  margin-left: auto;
  opacity: 0;
}
.nav:hover button .pip, .nav.pinned button .pip { opacity: 1; }

.stage { min-width: 0; min-height: 0; height: 100%; position: relative; overflow: auto; }
.view { height: 100%; min-height: 0; animation: rise 0.55s var(--ease); }

.dash {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, min(400px, 32vw));
  grid-template-rows: minmax(160px, 1fr) minmax(128px, 24vh);
  gap: clamp(8px, 1vw, 14px);
}
.map-space { position: relative; min-height: 0; }
.filters {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}
.pill {
  border: 1px solid var(--line);
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  backdrop-filter: blur(12px);
  font-weight: 650;
  font-size: 13px;
}
.pill.on, .pill.solid {
  background: linear-gradient(180deg, #d7f1ff, #8fd4ff);
  color: #102033;
  border-color: transparent;
}
.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
  animation: pop 0.6s var(--ease) both;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.pin.hold {
  z-index: 5;
  animation: none;
  cursor: grabbing;
}
.pin.hold .stem { animation: none; }
.pin button.tag {
  border: 1px solid rgba(255, 255, 255, 0.12);
  height: auto;
  max-width: 210px;
  padding: 7px 10px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  background: rgba(12, 20, 30, 0.82);
  color: white;
  backdrop-filter: blur(10px);
}
.pin button.tag b,
.pin button.tag span,
.pin button.tag small {
  display: block;
  max-width: 188px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}
.pin button.tag b { font-size: 13px; font-weight: 750; }
.pin button.tag span,
.pin button.tag small { font-size: 12px; font-weight: 650; color: rgba(255, 255, 255, 0.82); }
.pin.soon button.tag, .pin.late button.tag {
  background: linear-gradient(180deg, #d7f1ff, #8fd4ff);
  color: #102033;
}
.pin.soon button.tag span, .pin.soon button.tag small,
.pin.late button.tag span, .pin.late button.tag small { color: rgba(16, 32, 51, 0.78); }
.pin .stem {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 8px auto 0;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}
.detail {
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(360px, 92%);
  transform: translate(-50%, -50%);
  z-index: 3;
  padding: 14px;
  animation: pop 0.45s var(--ease);
}
.detail .badge { margin-bottom: 8px; }
.detail h3 { margin: 0 0 4px; padding-right: 28px; font-size: 20px; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.detail p { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.detail .big {
  margin: 10px 0 6px;
  font-size: 32px;
  letter-spacing: -0.04em;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.detail .big em { font-style: normal; font-size: 16px; color: var(--muted); font-weight: 650; }
.detail .meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--soft); font-size: 13px; margin-bottom: 12px; }
.x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(8, 14, 20, 0.45);
  color: white;
}

.panel { padding: 16px; min-height: 0; overflow: auto; }
.panel h2 {
  margin: 0 0 12px;
  font-size: clamp(18px, 1.6vw, 26px);
  letter-spacing: -0.04em;
  font-weight: 700;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
}
.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.metric {
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(8px, 1vw, 12px);
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.metric .k {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
.metric .k span { min-width: 0; }
.metric .n {
  margin-top: 8px;
  font-size: clamp(22px, 1.8vw, 30px);
  letter-spacing: -0.04em;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  line-height: 1.1;
}
.metric .n em { font-style: normal; font-size: 14px; color: var(--muted); font-weight: 650; }
.badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(6, 12, 18, 0.78);
  color: #f7fbff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}
.spark { width: 100%; height: 42px; display: block; margin-top: auto; color: var(--accent); }
.spark-fill { fill: var(--accent-soft); }
.bars-mini {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 48px;
  margin-top: auto;
}
.bars-mini i {
  flex: 1;
  display: block;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  transform-origin: bottom;
  animation: grow 0.8s var(--ease) both;
}
.bars-mini i.on { background: var(--accent); box-shadow: 0 0 12px rgba(143, 212, 255, 0.7); }
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}
.gauge-wrap svg { display: block; max-width: 100%; }
.gauge-track { stroke: var(--track); }
.gauge-value { stroke: var(--accent); animation: gauge-draw 0.9s var(--ease) both; }
.gauge-read { margin-top: 2px; text-align: center; }
.gauge-read strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.gauge-read small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 700;
}

.work {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(8, 14, 20, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.work .life { margin: 8px 0; }
.levels {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  width: min(380px, 48%);
  height: min(46%, 420px);
  min-height: 120px;
  max-height: calc(100% - 56px);
  overflow: hidden;
  margin: 0;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.levels .grip {
  flex: 0 0 16px;
  height: 16px;
  margin: 0 -12px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: ns-resize;
  touch-action: none;
}
.levels .grip::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin: 6px auto 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.62);
}
.level-list {
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.levels .who { color: var(--muted); font-size: 13px; font-weight: 650; }
.level-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 4px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  color: inherit;
  background: rgba(8, 14, 20, 0.28);
  border-radius: 16px;
  padding: 8px 10px;
}
.lvl-name { min-width: 0; display: flex; flex-direction: column; }
.lvl-name b, .lvl-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lvl-name small { color: var(--muted); font-size: 12px; }
.level-row em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--soft); }
.level-row .life { grid-column: 1 / -1; margin: 0; }
.work .who { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.work h3 {
  margin: 4px 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.segs { display: flex; gap: 6px; margin-top: 8px; }
.segs i { height: 8px; flex: 1; border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
.segs i.fill { background: linear-gradient(90deg, #7ec8f6, #d7f1ff); }

.bottom {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.9fr 1.15fr 0.95fr;
  gap: 14px;
  min-height: 0;
}
.card { padding: 16px 16px 12px; min-height: 0; overflow: hidden; }
.card h3 { margin: 0; font-size: 20px; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .hint, .hint { margin: 2px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.bottom .card .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 8px;
  align-items: center;
}
.donut-fig { position: relative; width: 124px; height: 124px; }
.donut-fig strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 26px;
  letter-spacing: -0.04em;
}
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend b { font-size: 20px; letter-spacing: -0.03em; }
.legend div { font-size: 14px; color: var(--soft); }
.dotc {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px;
  background: var(--accent);
}
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}
.chart span {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}
.chart i {
  width: 100%;
  max-width: 16px;
  border-radius: 8px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.28);
  transform-origin: bottom;
  animation: grow 0.9s var(--ease) both;
}
.chart i.hot {
  background: linear-gradient(180deg, #eaf7ff, #7ec8f6);
  box-shadow: 0 0 16px rgba(143, 212, 255, 0.45);
}
.chart em { font-style: normal; color: var(--muted); font-size: 10px; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.msg, button.msg {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  padding: 0;
}
.msg i {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(143, 212, 255, 0.15);
  color: var(--accent-2);
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
}
.msg b, .msg small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg b { font-size: 14px; }
.msg small { color: var(--muted); font-size: 12px; }

.page {
  height: 100%;
  overflow: auto;
  padding-right: 4px;
}
.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.mcard { padding: 16px; min-width: 0; }
.mcard h3 {
  margin: 8px 0 4px;
  font-size: 18px;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.life {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 12px 0;
}
.life b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5aa6d6, #d7f1ff);
  transform-origin: left;
  animation: growx 0.8s var(--ease);
}
.life.late b, .life.soon b { background: linear-gradient(90deg, #d7f1ff, #ffffff); }
.rowline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  align-items: center;
  min-width: 0;
}
.rowline > div { min-width: 0; }
.rowline b { overflow-wrap: anywhere; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.order-box { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 14px; align-items: start; }
textarea.slip {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.page-head h2, .page h2 { margin: 0 0 12px; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.page-head h2 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 10, 16, 0.5);
}
.sheet {
  width: min(640px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  padding: 18px 18px 16px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.preview {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.big-num { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; }
.pair { display: flex; gap: 8px; flex-wrap: wrap; }
.pair .btn { flex: 1; }
.set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 880px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.pin { animation-name: pinIn; }
@keyframes pinIn {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 10px transparent; }
}
@keyframes gauge-draw {
  from { stroke-dashoffset: 260; }
  to { stroke-dashoffset: 0; }
}
@keyframes grow {
  from { transform: scaleY(0.05); }
  to { transform: scaleY(1); }
}
@keyframes growx {
  from { transform: scaleX(0.05); }
  to { transform: scaleX(1); }
}

body.day {
  --ink: #181A2F;
  --muted: #37415C;
  --soft: #242E49;
  --line: rgba(24, 26, 47, 0.14);
  --glass: linear-gradient(180deg, rgba(255, 247, 242, 0.9), rgba(253, 214, 190, 0.84));
  --glass-2: linear-gradient(180deg, rgba(255, 251, 247, 0.94), rgba(255, 226, 206, 0.88));
  --accent: #B4182D;
  --accent-2: #8d2434;
  --accent-soft: rgba(253, 164, 129, 0.45);
  --track: rgba(24, 26, 47, 0.14);
  --field: rgba(255, 255, 255, 0.82);
  --chip: rgba(255, 246, 240, 0.86);
  --shadow: 0 22px 48px rgba(84, 22, 43, 0.18);
  --photo: url("assets/bg-day.jpg");
  --veil: linear-gradient(180deg, rgba(255, 244, 236, 0.08), rgba(24, 26, 47, 0.18));
  background: #c9b29f;
  color-scheme: light;
}
body.day .bg { filter: saturate(1.02) contrast(1.02); }
body.day .bg::after {
  background: radial-gradient(120% 80% at 70% 40%, transparent 0%, rgba(24, 26, 47, 0.08) 72%, rgba(24, 26, 47, 0.22) 100%);
}
body.day .btn {
  background: linear-gradient(180deg, #ffd8c2, #FDA481);
  color: #181A2F;
  box-shadow: 0 8px 22px rgba(180, 24, 45, 0.16);
}
body.day .pill.on, body.day .pill.solid {
  background: linear-gradient(180deg, #ffd8c2, #FDA481);
  color: #181A2F;
}
body.day .badge {
  background: #fff8f3;
  color: #3a1020;
  border-color: rgba(84, 22, 43, 0.35);
}
body.day .levels .grip::before { background: rgba(24, 26, 47, 0.45); }
body.day .brand .mark { box-shadow: 0 0 22px rgba(253, 164, 129, 0.55); }
body.day .pin.soon button.tag span, body.day .pin.soon button.tag small,
body.day .pin.late button.tag span, body.day .pin.late button.tag small { color: rgba(24, 26, 47, 0.78); }
body.day .avatar { background: linear-gradient(180deg, #ffe6d4, #FDA481); color: #181A2F; }
body.day .bars-mini i { background: rgba(24, 26, 47, 0.22); }
body.day .bars-mini i.on { background: #B4182D; box-shadow: 0 0 12px rgba(180, 24, 45, 0.35); }
body.day .chart i { background: rgba(24, 26, 47, 0.2); }
body.day .chart i.hot { background: linear-gradient(180deg, #FDA481, #B4182D); box-shadow: 0 0 14px rgba(180, 24, 45, 0.28); }
body.day .life { background: rgba(24, 26, 47, 0.1); }
body.day .life b, body.day .segs i.fill { background: linear-gradient(90deg, #B4182D, #FDA481); }
body.day .segs i { background: rgba(24, 26, 47, 0.12); }
body.day .work, body.day .check, body.day .level-row { background: rgba(255, 255, 255, 0.42); }
body.day .msg i { background: rgba(180, 24, 45, 0.1); color: #B4182D; }
body.day .iconbtn, body.day .x { color: #181A2F; }
body.day .pin.soon button.tag, body.day .pin.late button.tag {
  background: linear-gradient(180deg, #ffd8c2, #FDA481);
  color: #181A2F;
}
body.day .modal { background: rgba(24, 26, 47, 0.28); }

@media (max-width: 1280px) and (min-width: 781px) {
  .shell { gap: 10px; padding: 12px; }
  .pin button.tag { max-width: 168px; padding: 6px 8px; }
  .pin button.tag b { font-size: 12px; }
  .pin button.tag span, .pin button.tag small { font-size: 11px; }
  .card { padding: 12px; }
  .card h3 { font-size: clamp(15px, 1.3vw, 20px); }
  .chart { height: clamp(72px, 12vh, 120px); }
  .donut-fig { width: 104px; height: 104px; }
  .donut { grid-template-columns: 108px minmax(0, 1fr); }
}
@media (max-height: 760px) and (min-width: 781px) {
  .dash { grid-template-rows: minmax(180px, 1fr) minmax(112px, 150px); }
  .metric { padding: 8px; }
  .metric .n { font-size: 22px; margin-top: 4px; }
  .spark { height: 22px; }
  .bars-mini { height: 28px; }
  .gauge-wrap svg { height: 58px; width: auto; }
  .gauge-read strong { font-size: 20px; }
  .work { margin-top: 4px; padding: 6px 8px; }
  .work h3 { margin: 2px 0; font-size: 14px; }
  .work .life { margin: 4px 0; }
  .panel { padding: 10px 12px; }
  .panel h2 { margin-bottom: 6px; font-size: 18px; }
  .chart { height: 64px; }
}
@media (max-width: 780px) {
  html, body, #app { height: auto; min-height: 100%; overflow: auto; }
  .shell {
    height: auto;
    max-height: none;
    min-height: 100%;
    overflow: visible;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 12px;
  }
  .top { flex-wrap: wrap; min-height: 0; }
  .search { flex: 1 1 100%; max-width: none; order: 5; }
  .userchip small { display: none; }
  .nav {
    width: auto !important;
    margin-top: 0;
    flex-direction: row;
    overflow-x: auto;
  }
  .nav button { flex: 0 0 auto; height: 42px; padding: 0 12px; }
  .nav button span { opacity: 1; transform: none; }
  .stage { height: auto; overflow: visible; }
  .view { height: auto; }
  .dash, .bottom, .page-grid, .order-box, .set-grid, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .dash {
    height: auto;
    grid-template-rows: minmax(300px, 62vh) auto auto;
  }
  .map-space { min-height: 300px; }
  .levels {
    width: min(280px, 72%);
    height: min(42%, 230px);
  }
  .bottom { grid-column: auto; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .panel { overflow: visible; }
  .donut { grid-template-columns: 108px minmax(0, 1fr); }
}
