:root {
  --bg: #09090c;
  --ink: #f3f0ed;
  --muted: #aaa3ac;
  --line: #30262f;
  --accent: #ec3b52;
  --deep: #ad2235;
  --mint: #341922;
  --sleep-color: #efc478;
  --water-color: #fa6177;
  --steps-color: #d9a75a;
  --radius: 18px;
  --shadow: 0 3px 14px #00000035;
  font-family: Tahoma,Arial,sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
}
button,input,textarea {
  font: inherit;
}
button,a,input,textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible {
  outline: 3px solid #f2c976;
  outline-offset: 3px;
}
button,input,textarea {
  transition: background-color .16s,border-color .16s,box-shadow .16s;
}
h1,h2,h3,p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.45;
  letter-spacing: -.5px;
  font-weight: 600;
}
h2 {
  font-size: 18px;
  font-weight: 600;
}
p {
  color: var(--muted);
}
[hidden] {
  display: none!important;
}
.icon {
  height: 21px;
  width: 21px;
  stroke: currentColor;
  stroke-width: 1.65;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 226px;
  flex-shrink: 0;
  background: #141116;
  border-left: 1px solid var(--line);
  padding: 36px 22px 25px;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 20;
}
.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 0 12px 41px;
  width: fit-content;
}
.brand-mark {
  width: 48px;
  height: 48px;
  background: var(--deep);
  color: #f2c878;
  display: grid;
  place-items: center;
  border-radius: 15px;
}
.brand-mark .icon {
  width: 29px;
  height: 29px;
  stroke-width: 1.8;
}
.brand strong {
  font-size: 32px;
  line-height: 1;
  display: block;
  font-weight: 600;
}
.brand-dot {
  color: var(--accent);
}
.brand small {
  font-family: Arial,sans-serif;
  font-size: 10px;
  letter-spacing: 3.5px;
  display: block;
  margin-top: 6px;
  color: var(--muted);
  text-align: center;
}
.nav-label {
  color: #a597a1;
  font-size: 12px;
  padding: 0 14px 14px;
}
.sidebar nav {
  display: grid;
  gap: 9px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  font-size: 14px;
  text-align: right;
  width: 100%;
  font-weight: 500;
  white-space: nowrap;
}
.nav-item .icon {
  color: #a89ea8;
}
.nav-item:hover {
  background: #20151d;
}
.nav-item.active {
  background: #2a181b;
  color: var(--deep);
}
.nav-item.active .icon {
  color: var(--accent);
}
.nav-count {
  font-family: Arial,sans-serif;
  font-size: 11px;
  margin-inline-start: auto;
  border: 1px solid #403338;
  border-radius: 5px;
  padding: 0 5px;
  color: #bfab91;
  background: #141116;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 30px 14px 0;
}
.privacy-icon {
  height: 34px;
  width: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #cca65f;
  background: #2a2017;
  margin-bottom: 14px;
}
.sidebar-bottom strong {
  font-size: 14px;
  font-weight: 500;
}
.sidebar-bottom p {
  font-size: 13px;
  line-height: 1.9;
  margin-top: 4px;
}
.sidebar-version {
  font-size: 11px;
  color: #92858f;
  display: block;
  margin-top: 36px;
}
.workspace {
  width: calc(100% - 226px);
  margin-inline-start: 226px;
}
.topbar {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 38px;
  background: #100d12d9;
}
.topbar-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
}
.topbar-label .icon {
  color: var(--accent);
  width: 19px;
}
.topbar-date {
  font-size: 13px;
  color: var(--muted);
}
main {
  max-width: 1530px;
  margin: auto;
  padding: 32px 38px 20px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.eyebrow {
  font-size: 12px;
  color: var(--accent);
  display: block;
  font-weight: 500;
  margin-bottom: 3px;
}
.page-heading p {
  font-size: 14px;
  margin-top: 7px;
}
.button {
  padding: 10px 19px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  min-height: 43px;
  white-space: nowrap;
}
.primary {
  background: var(--accent);
  color: #fff4ee;
  box-shadow: 0 4px 8px #f2365230;
}
.primary:hover {
  background: #ce243c;
}
.secondary {
  background: #141116;
  border: 1px solid #393038;
}
.secondary:hover {
  background: #231b24;
}
.quiet {
  color: var(--muted);
  font-size: 13px;
  padding: 6px 0;
}
.quiet:hover {
  color: var(--accent);
}
.quiet .icon {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 23px;
  flex-wrap: wrap;
}
.range-controls {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  background: #131015;
  border: 1px solid #352a33;
  padding: 3px;
  border-radius: 9px;
  gap: 3px;
}
.segmented button {
  font-size: 13px;
  padding: 5px 15px;
  min-height: 32px;
  border-radius: 6px;
  color: #b3a9b1;
  white-space: nowrap;
}
.segmented button.active {
  background: #141116;
  box-shadow: 0 1px 4px #00000035;
  color: var(--deep);
  font-weight: 500;
}
.range-navigator {
  display: flex;
  gap: 5px;
  align-items: center;
}
.range-navigator>span {
  font-size: 12px;
  color: var(--muted);
}
.icon-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}
.icon-button:hover {
  background: #2d1b27;
  color: var(--accent);
}
.icon-button .icon {
  width: 17px;
  height: 17px;
}
.rotate {
  transform: rotate(180deg);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: #141116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 19px 21px 16px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  color: #bab3b7;
}
.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #32171e;
  color: var(--accent);
  display: grid;
  place-items: center;
}
.purple {
  color: var(--sleep-color)!important;
  background: #332919;
}
.blue {
  color: var(--water-color)!important;
  background: #35151f;
}
.orange {
  color: var(--steps-color)!important;
  background: #2e2316;
}
.stat-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 7px;
  white-space: nowrap;
}
.stat-value b {
  font: 500 36px/1.7 Tahoma,Arial,sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.stat-value>span {
  font-size: 12px;
  color: #a89ba4;
}
.stat-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 27px;
}
.stat-bottom>span:first-child {
  font-size: 12px;
  color: #a99fa5;
}
.featured {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff4ee;
}
.featured .stat-top {
  color: #f0cbd0;
}
.featured .metric-icon {
  color: #ffadbb;
  background: #ff87921a;
}
.featured .stat-value>span {
  color: #dba5ad;
}
.featured .stat-bottom>span:first-child {
  color: #e2bcc1;
}
.mini-line {
  width: 63px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.mini-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.panel {
  background: #141116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px 24px 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 17px;
}
.panel-heading p {
  font-size: 12px;
  margin-top: 3px;
}
.charts-grid {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) minmax(0,1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
  color: var(--muted);
}
.legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.small-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
}
.chart {
  height: 232px;
  position: relative;
  direction: ltr;
}
.chart>svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}
.chart text {
  font: 12px Tahoma,Arial,sans-serif;
  fill: #a99da7;
}
.chart .axis-grid {
  stroke: #352a31;
  stroke-width: 1;
  stroke-dasharray: 4 5;
}
.chart .hit-point:hover {
  fill: var(--accent);
}
.chart-foot {
  border-top: 1px solid #31262f;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 10px;
  gap: 10px;
  font-size: 12px;
  color: #a69ba5;
  min-height: 35px;
}
.change-label {
  color: var(--accent);
  white-space: nowrap;
}
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  text-align: center;
  background: linear-gradient(90deg,#15111600,#100d12d9 25%,#151116e8 75%,#15111600);
  direction: rtl;
}
.chart-empty .empty-symbol {
  height: 45px;
  width: 45px;
  background: #2c1e19;
  color: #d9b06d;
  display: grid;
  place-items: center;
  border-radius: 14px;
  margin-bottom: 5px;
}
.chart-empty strong {
  font-size: 15px;
  font-weight: 500;
}
.chart-empty p {
  font-size: 12px;
  max-width: 260px;
}
.secondary-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.text-button {
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 0;
  white-space: nowrap;
}
.text-button:hover {
  color: #ffe0a4;
  text-decoration: underline;
}
.week-days {
  display: grid;
  grid-template-columns: repeat(7,minmax(0,1fr));
  gap: 7px;
  margin: 21px 0;
}
.day-pill {
  border: 1px solid #352b34;
  background: #171218;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9px 2px;
  color: var(--muted);
  gap: 4px;
  min-width: 0;
}
.day-pill .day-name {
  font-size: 10px;
}
.day-pill .day-date {
  font: 500 18px/1.3 Arial,sans-serif;
  margin: 2px 0;
}
.day-pill .day-status {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #33242d;
  color: #a6919a;
  font-size: 12px;
}
.day-pill .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}
.day-pill.logged {
  background: #251a19;
  border-color: #5a322b;
  color: #ecc478;
}
.day-pill.logged .day-status {
  background: #edc16d;
  color: #fff4ee;
}
.day-pill.today {
  border-color: #f6c773;
}
.day-pill:hover {
  border-color: var(--accent);
}
.day-pill:disabled {
  opacity: .4;
}
.week-insights {
  display: flex;
  border-top: 1px solid var(--line);
  padding-top: 15px;
  gap: 25px;
}
.week-insights>div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.week-insights>div+div {
  padding-inline-start: 25px;
  border-inline-start: 1px solid var(--line);
}
.week-insights span {
  font-size: 12px;
  color: var(--muted);
}
.week-insights strong {
  font-size: 15px;
  font-weight: 500;
}
.compact {
  background: #231b24;
}
.compact button {
  font-size: 12px;
  padding: 3px 12px;
  min-height: 27px;
}
.small-chart {
  height: 171px;
}
.records-panel {
  padding-bottom: 8px;
}
.table-wrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  text-align: right;
}
th {
  color: #a69ba5;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  background: #1b151c;
  border-top: 1px solid #30252e;
  border-bottom: 1px solid #30252e;
  padding: 11px 12px;
}
td {
  border-bottom: 1px solid #30252e;
  padding: 15px 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
tr:last-child td {
  border-bottom: 0;
}
td .muted {
  font-size: 12px;
  color: #a89ca5;
  margin-inline-start: 3px;
}
.table-date {
  display: flex;
  align-items: center;
  gap: 9px;
}
.table-date>span {
  background: #2c231b;
  border-radius: 7px;
  padding: 2px 8px;
  color: #bfa175;
  font-size: 13px;
  min-width: 31px;
  text-align: center;
}
.table-date strong {
  font-size: 13px;
  font-weight: 500;
}
.mood-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  background: #2c231a;
  color: #e4be7c;
  border-radius: 5px;
  padding: 2px 8px;
}
.row-actions {
  display: flex;
  gap: 2px;
}
.row-actions .icon-button {
  width: 29px;
  min-width: 29px;
  height: 29px;
}
.empty-records {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 32px 10px 38px;
  text-align: center;
}
.empty-records .icon {
  color: #c2a16c;
  width: 30px;
  height: 30px;
  margin-bottom: 2px;
}
.empty-records strong {
  font-size: 15px;
  font-weight: 500;
}
.empty-records p {
  font-size: 13px;
}
.empty-records .text-button {
  margin-top: 2px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 1px 0;
  font-size: 11px;
  color: #a1939c;
}
.page-footer>span:first-child {
  display: flex;
  align-items: center;
  gap: 5px;
}
.page-footer .icon {
  width: 12px;
  height: 12px;
}
.status-banner {
  border: 1px solid #5d4931;
  border-radius: 11px;
  background: #2a2217;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #eac385;
}
.status-banner.demo {
  background: #211b13;
  border-color: #58432e;
  color: #e2bc77;
}
.status-banner a {
  font-weight: 600;
  text-decoration: underline;
}
.status-banner button {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
}
.status-banner.error {
  background: #2a131b;
  border-color: #5f2532;
  color: #f6a8b4;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0;
  border-radius: 22px;
  box-shadow: 0 30px 90px #000000b3;
  max-width: calc(100% - 32px);
  width: 610px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: #141116;
}
dialog::backdrop {
  background: #000000a6;
  backdrop-filter: blur(5px);
}
dialog.week-mode {
  width: 800px;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 23px 27px 16px;
  gap: 15px;
}
.dialog-heading h2 {
  font-size: 24px;
}
.entry-modes {
  margin: 0 27px;
  display: flex;
}
.entry-modes button {
  flex: 1;
  padding: 7px 10px;
  font-size: 14px;
}
.dialog-content {
  padding: 20px 27px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
}
.field>span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.field .icon {
  width: 18px;
  height: 18px;
  color: #d9b877;
}
.date-field input {
  max-width: 250px;
}
.field-note {
  font-size: 12px;
  color: #ada0a8;
  margin: 9px 0 19px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 19px;
  margin-top: 8px;
}
input:not([type=radio]),textarea {
  border: 1px solid #3c303a;
  border-radius: 9px;
  background: #19131b;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 400;
  width: 100%;
  font-size: 15px;
  outline-offset: 1px;
  min-width: 0;
}
input::placeholder,textarea::placeholder {
  color: #93848f;
  font-size: 13px;
}
input[type=date] {
  direction: ltr;
  text-align: right;
}
input[type=number] {
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input:focus,textarea:focus {
  border-color: #efbd67;
  background: #141116;
}
.unit-input {
  position: relative;
  display: flex;
  align-items: center;
}
.unit-input>span {
  position: absolute;
  inset-inline-end: 12px;
  font-size: 12px;
  color: #b3a395;
  pointer-events: none;
}
.unit-input input {
  padding-left: 54px;
  padding-right: 12px;
}
.unit-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.mood-field {
  border: 0;
  padding: 0;
  margin: 24px 0 17px;
}
.mood-field legend {
  font-size: 14px;
  font-weight: 500;
  padding: 0 0 10px;
}
.mood-field legend span,.optional {
  font-size: 12px;
  font-weight: 400;
  color: #aa9d9d;
  margin-inline-start: 5px;
}
.mood-options {
  display: flex;
  gap: 7px;
}
.mood-options label {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.mood-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.mood-options label>span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid #382d35;
  border-radius: 10px;
  padding: 9px 3px;
  font-size: 12px;
  color: #b3a5ac;
}
.mood-options b {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  line-height: 20px;
  text-align: center;
  font-family: Arial,sans-serif;
  font-size: 19px;
  font-weight: 400;
}
.mood-options input:checked+span {
  background: #2f2518;
  border-color: #b68a43;
  color: var(--accent);
}
.mood-options input:focus-visible+span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.clear-mood {
  font-size: 12px;
  margin-top: 4px;
}
.dialog-footer {
  position: sticky;
  bottom: 0;
  background: #141116;
  border-top: 1px solid var(--line);
  padding: 17px 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  z-index: 1;
}
.dialog-footer>span {
  font-size: 12px;
  color: #b1a38f;
  display: flex;
  gap: 5px;
  align-items: center;
}
.dialog-footer>span .icon {
  width: 14px;
  height: 14px;
}
.dialog-footer>div {
  display: flex;
  gap: 9px;
}
.form-error {
  padding: 10px 14px;
  border-radius: 8px;
  background: #30141e;
  color: #ffacb8;
  font-size: 13px;
  margin-top: 15px;
}
.small-dialog {
  width: 420px;
}
.small-dialog h2 {
  font-size: 21px;
}
.delete-description {
  padding: 0 27px 25px;
  font-size: 14px;
}
.small-dialog .form-error {
  margin: 0 27px 20px;
}
.danger {
  color: #fff4ee;
  background: #ba243a;
}
.danger:hover {
  background: #ca2440;
}
.week-editor-wrap {
  overflow-x: auto;
}
.week-editor th {
  padding: 9px;
}
.week-editor th small {
  display: block;
  font-size: 11px;
}
.week-editor td {
  padding: 8px 5px;
}
.week-editor input {
  padding: 7px 8px;
  width: 100%;
  min-width: 80px;
  font-size: 14px;
  min-height: 39px;
}
.week-editor td:first-child {
  min-width: 100px;
  font-size: 13px;
}
.week-editor td:first-child span {
  display: block;
  font-size: 11px;
  color: #aa9b99;
}
.week-editor tr.future {
  opacity: .4;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #21161b;
  color: #fff4ee;
  border: 1px solid #715936;
  padding: 12px 23px;
  border-radius: 12px;
  box-shadow: 0 12px 24px #00000080;
  z-index: 100;
  font-size: 14px;
  max-width: calc(100% - 30px);
  text-align: center;
}
.chart-tooltip {
  position: absolute;
  transform: translate(-50%,-100%);
  background: #23151d;
  color: #fff4ee;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
  direction: rtl;
}
.chart-tooltip strong {
  font-family: Arial,sans-serif;
  margin-inline-start: 5px;
}
.table-note {
  display: block;
  white-space: normal;
  max-width: 180px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 3px;
}
.history-mode .stats-grid,.history-mode .charts-grid,.history-mode .secondary-grid {
  display: none;
}
.history-mode .records-panel {
  margin-top: 8px;
}
#records-content .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  color: var(--muted);
  font-size: 13px;
}
.weekly-note {
  display: inline-block;
  background: #2e2316;
  color: #d4ad70;
  padding: 1px 8px;
  border-radius: 5px;
  margin-inline-start: 7px;
  font-size: 11px;
}
@media(min-width:1550px) {
  main {
    padding-top: 40px;
  }
  .stats-grid {
    gap: 22px;
  }
  .stat-card {
    padding: 24px;
  }
  .chart {
    height: 265px;
  }
  .small-chart {
    height: 180px;
  }
}
@media(max-width:1200px) {
  .sidebar {
    width: 204px;
    padding-inline: 14px;
  }
  .workspace {
    width: calc(100% - 204px);
    margin-inline-start: 204px;
  }
  main {
    padding: 28px 25px 20px;
  }
  .topbar {
    padding-inline: 25px;
  }
  .stats-grid {
    gap: 12px;
  }
  .stat-card {
    padding: 16px;
  }
  .stat-value b {
    font-size: 30px;
  }
  .stat-top {
    font-size: 13px;
  }
  .stat-bottom>span:first-child {
    font-size: 11px;
  }
  .mini-line {
    width: 44px;
  }
  .panel {
    padding: 20px 19px 14px;
  }
  .charts-grid {
    grid-template-columns: 1.45fr 1fr;
  }
  .secondary-grid {
    gap: 18px;
  }
  .week-days {
    gap: 4px;
  }
  .day-pill .day-name {
    font-size: 9px;
  }
  .week-insights {
    gap: 17px;
  }
  .week-insights>div+div {
    padding-inline-start: 17px;
  }
}
@media(max-width:1000px) {
  .sidebar {
    width: 82px;
    padding: 25px 12px;
    align-items: center;
  }
  .brand {
    padding: 0 0 36px;
  }
  .brand>span:last-child,.nav-label,.nav-item>span,.sidebar-bottom {
    display: none;
  }
  .nav-item {
    padding: 14px;
    width: 49px;
    justify-content: center;
  }
  .workspace {
    width: calc(100% - 82px);
    margin-inline-start: 82px;
  }
  .charts-grid {
    grid-template-columns: 1.3fr 1fr;
  }
  .stat-value b {
    font-size: 31px;
  }
  .stat-value>span {
    font-size: 11px;
  }
  .stat-bottom .mini-line {
    display: none;
  }
}
@media(max-width:760px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 13px;
  }
  .stat-card {
    padding: 18px 19px;
  }
  .stat-value b {
    font-size: 34px;
  }
  .stat-bottom .mini-line {
    display: block;
  }
  .charts-grid,.secondary-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .chart {
    height: 240px;
  }
  .small-chart {
    height: 185px;
  }
  .page-heading {
    align-items: center;
  }
  h1 {
    font-size: 28px;
  }
  .topbar-date {
    font-size: 12px;
  }
  .page-heading p {
    font-size: 13px;
    max-width: 270px;
  }
  .legend {
    font-size: 11px;
  }
  .day-pill .day-name {
    font-size: 11px;
  }
  .range-controls {
    gap: 9px;
  }
  .toolbar {
    row-gap: 13px;
  }
  .panel-heading {
    margin-bottom: 14px;
  }
  .page-footer {
    flex-direction: column;
    gap: 4px;
  }
  .week-days {
    gap: 8px;
  }
  .day-pill {
    padding: 11px 3px;
  }
}
@media(max-width:540px) {
  .sidebar {
    position: fixed;
    inset-block-start: auto;
    inset-block-end: 0;
    inset-inline: 0;
    width: 100%;
    height: 72px;
    padding: 4px 10px max(4px,env(safe-area-inset-bottom));
    background: #100d12f5;
    border-top: 1px solid var(--line);
    border-left: 0;
    backdrop-filter: blur(12px);
  }
  .sidebar .brand {
    display: none;
  }
  .sidebar nav {
    display: flex;
    width: 100%;
    justify-content: space-around;
    gap: 0;
  }
  .nav-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: auto;
    flex: 1;
    padding: 7px 2px;
    border-radius: 9px;
    min-width: 0;
  }
  .nav-item>span {
    display: block;
    font-size: 11px;
  }
  .nav-item>span.nav-count {
    display: none;
  }
  .nav-item .icon {
    width: 21px;
    height: 21px;
  }
  .nav-item.active {
    background: transparent;
    color: var(--accent);
  }
  .workspace {
    width: 100%;
    margin: 0;
  }
  .topbar {
    height: 60px;
    padding: 0 20px;
  }
  .topbar-label {
    font-size: 13px;
  }
  .topbar-date {
    font-size: 11px;
  }
  main {
    padding: 24px 16px 90px;
  }
  .page-heading {
    gap: 12px;
    margin-bottom: 23px;
  }
  .page-heading h1 {
    font-size: 27px;
  }
  .eyebrow {
    font-size: 11px;
  }
  .page-heading p {
    font-size: 12px;
    max-width: 215px;
    line-height: 1.8;
  }
  .page-heading>.button {
    font-size: 12px;
    padding: 10px 12px;
    gap: 5px;
  }
  .page-heading>.button .icon {
    width: 17px;
    height: 17px;
  }
  .range-controls {
    justify-content: space-between;
    width: 100%;
    gap: 7px;
  }
  .segmented button {
    padding: 4px 11px;
    font-size: 12px;
  }
  .range-navigator {
    gap: 0;
  }
  .range-navigator>span {
    font-size: 10px;
  }
  .range-navigator .icon-button {
    width: 24px;
    min-width: 24px;
  }
  .toolbar {
    margin-bottom: 18px;
  }
  .quiet {
    font-size: 12px;
  }
  .stats-grid {
    gap: 12px;
    margin-bottom: 18px;
  }
  .stat-card {
    padding: 14px 15px 13px;
    border-radius: 15px;
  }
  .stat-top {
    font-size: 12px;
  }
  .metric-icon {
    width: 29px;
    height: 29px;
    border-radius: 9px;
  }
  .metric-icon .icon {
    height: 18px;
    width: 18px;
  }
  .stat-value {
    gap: 5px;
    margin-top: 7px;
  }
  .stat-value b {
    font-size: 32px;
  }
  .stat-value>span {
    font-size: 10px;
  }
  .stat-bottom>span:first-child {
    font-size: 10px;
  }
  .mini-line {
    width: 42px!important;
  }
  .panel {
    padding: 19px 16px 13px;
    border-radius: 16px;
  }
  h2 {
    font-size: 17px;
  }
  .panel-heading p {
    font-size: 11px;
  }
  .chart {
    height: 218px;
  }
  .chart text {
    font-size: 12px;
  }
  .chart-foot {
    font-size: 11px;
  }
  .secondary-grid,.charts-grid {
    margin-bottom: 18px;
  }
  .small-chart {
    height: 173px;
  }
  .week-days {
    gap: 5px;
    margin-top: 18px;
  }
  .day-pill {
    border-radius: 8px;
  }
  .day-pill .day-name {
    font-size: 10px;
  }
  .day-pill .day-date {
    font-size: 17px;
  }
  .week-insights span {
    font-size: 11px;
  }
  .week-insights strong {
    font-size: 14px;
  }
  .text-button {
    font-size: 12px;
  }
  .status-banner {
    font-size: 12px;
    padding: 10px 12px;
  }
  .status-banner button {
    font-size: 12px;
  }
  .status-banner {
    align-items: flex-start;
  }
  .page-footer {
    font-size: 10px;
  }
  dialog {
    max-width: calc(100% - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 18px;
  }
  .dialog-heading {
    padding: 20px 19px 14px;
  }
  .dialog-heading h2 {
    font-size: 22px;
  }
  .entry-modes {
    margin-inline: 19px;
  }
  .entry-modes button {
    font-size: 14px;
  }
  .dialog-content {
    padding: 18px 19px;
  }
  .form-grid {
    gap: 15px;
  }
  .field {
    font-size: 13px;
  }
  .dialog-footer {
    padding: 14px 19px;
  }
  .dialog-footer>span {
    display: none;
  }
  .dialog-footer>div {
    width: 100%;
  }
  .dialog-footer .primary {
    flex: 1;
  }
  .dialog-footer .button {
    font-size: 13px;
  }
  .mood-options {
    gap: 5px;
  }
  .mood-options label>span {
    font-size: 11px;
    padding: 9px 1px;
  }
  .toast {
    bottom: 85px;
    width: max-content;
  }
  .week-editor th {
    font-size: 11px;
  }
  .chart-empty p {
    font-size: 11px;
  }
  .stat-bottom .mini-line {
    display: none;
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    transition: none!important;
    scroll-behavior: auto!important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.mood-tag .icon {
  width: 14px;
  height: 14px;
}
.week-editor input:disabled {
  background: #201920;
}
/* =========================================================
   ETTIZAN · MIDNIGHT EDITION
   Black surfaces, ruby actions, gold details, restrained glow.
   ========================================================= */
:root {
  color-scheme: dark;
  --gold: #efc476;
  --gold-bright: #ffe0a2;
  --ruby: #f13b55;
  --panel: #151116;
  --shadow: 0 8px 28px #00000024;
}
body {
  background-color: var(--bg);
  background-image: radial-gradient(ellipse at 92% 0%, #c2253e12 0%, transparent 45%),
    radial-gradient(ellipse at 0% 80%, #9d74100a 0%, transparent 45%);
  background-attachment: fixed;
}
::selection {
  background: #ae304c;
  color: #fff3eb;
}
.sidebar {
  background: linear-gradient(175deg, #120e13, #09090c 72%);
  border-color: #cb9d4723;
  box-shadow: -8px 0 30px #00000016;
}
.brand strong {
  color: #fff2df;
}
.brand-dot {
  color: var(--ruby);
  text-shadow: 0 0 15px #ff3c6270;
}
.brand small {
  color: #c4a46e;
}
.brand-mark {
  color: var(--gold);
  background: linear-gradient(145deg, #3c1823, #1d1018);
  border: 1px solid #d7a55265;
  box-shadow: 0 0 21px #ed34522a, inset 0 0 12px #e2ad3210;
}
.brand-mark .icon {
  filter: drop-shadow(0 0 5px #ffd17080);
}
.nav-item.active {
  color: var(--gold-bright);
  background: linear-gradient(90deg, #b81f310a, #b81f312c);
  box-shadow: inset -2px 0 0 #f34660, 0 0 18px #e22f4310;
  border: 1px solid #e13b4d25;
}
.nav-item.active .icon {
  color: var(--ruby);
  filter: drop-shadow(0 0 4px #ff3c6260);
}
.nav-count {
  background: #20151a;
}
.sidebar-bottom strong {
  color: #d9c7ad;
}
.privacy-icon {
  color: var(--gold);
  border: 1px solid #b5914033;
}
.sidebar-version {
  color: #92828c;
}
.topbar {
  background: #0e0b10c9;
  border-color: #cfa45c1c;
  backdrop-filter: blur(18px);
}
.topbar-label .icon {
  filter: drop-shadow(0 0 5px #f5425755);
}
.topbar-date {
  color: #baa685;
}
.eyebrow {
  color: var(--gold);
}
h1 {
  color: #fff1e6;
}
h2 {
  color: #ede1d6;
}
.button.primary {
  background: linear-gradient(130deg, #e12b48, #a81730);
  border: 1px solid #ff66844d;
  color: #fff8f2;
  box-shadow: 0 0 21px #f72d4733, inset 0 1px 0 #ffffff1a;
}
.button.primary:hover {
  background: linear-gradient(130deg, #f3405b, #c11f3c);
  box-shadow: 0 0 30px #f735534d, inset 0 1px 0 #ffffff20;
}
.button.secondary {
  color: #d4c4cf;
  background: #211820;
  border-color: #554047;
}
.button.secondary:hover {
  background: #2c1d26;
  border-color: #ad87543d;
}
.quiet {
  color: #b9a58b;
}
.quiet:hover, .text-button {
  color: var(--gold);
}
.text-button:hover {
  color: var(--gold-bright);
}
.segmented {
  border-color: #70503c35;
  background: #110e13;
}
.segmented button.active {
  color: var(--gold-bright);
  background: linear-gradient(135deg, #3b2c1c, #281b19);
  box-shadow: inset 0 0 0 1px #f1bd6735, 0 0 10px #daa3310c;
}
.icon-button:hover {
  color: var(--gold);
  background: #33221e;
}
.stat-card, .panel {
  background: linear-gradient(145deg, #191219, #110e13 80%);
  border-color: #8c62722d;
  box-shadow: 0 10px 35px #00000026, inset 0 1px 0 #ffffff03;
}
.stat-card {
  transition: border-color .2s, box-shadow .2s;
}
.stat-card:hover {
  border-color: #d1a25363;
  box-shadow: 0 0 25px #c7972010;
}
.stat-card.featured {
  background: radial-gradient(ellipse at 5% 0%, #c8223940, transparent 70%), linear-gradient(140deg, #37121e, #1b0f16 75%);
  border-color: #ec3c555c;
  box-shadow: 0 0 30px #f029481b, inset 0 0 32px #e9273510;
}
.featured .stat-value b {
  color: #fff0e3;
  text-shadow: 0 0 22px #ff627445;
}
.stat-value b {
  color: #f3e8dc;
}
.metric-icon {
  border: 1px solid #f1415930;
  box-shadow: 0 0 12px #ec34471a;
}
.purple, .orange {
  border-color: #e0b15435;
  box-shadow: 0 0 14px #e5b44612;
}
.blue {
  border-color: #f446613d;
  box-shadow: 0 0 14px #ec344722;
}
.small-icon {
  border: 1px solid #edc36c28;
}
.mini-line svg {
  filter: drop-shadow(0 0 3px #efb94835);
}
.weight-panel {
  border-color: #d13a5136;
}
.sleep-panel {
  border-color: #b696423b;
}
.chart text {
  fill: #ac9da9;
}
.chart .axis-grid {
  stroke: #dcc7d315;
}
.chart .hit-point:hover {
  fill: var(--gold);
}
.weight-panel .chart path[stroke] {
  filter: drop-shadow(0 0 4px #ff3b5759);
}
.chart rect[data-tip] {
  filter: drop-shadow(0 0 4px #dba94a20);
}
.chart rect[data-tip]:hover, .chart rect[data-tip]:focus {
  fill-opacity: 1;
}
.legend i {
  background: var(--ruby);
  box-shadow: 0 0 10px #f4446369;
}
.change-label {
  color: var(--gold);
}
.chart-foot {
  border-color: #d2bca216;
}
.chart-empty {
  background: linear-gradient(90deg, #15101600, #151016d6 25%, #151016ed 75%, #15101600);
}
.chart-empty strong {
  color: #e9dcd1;
}
.chart-empty .empty-symbol {
  color: var(--gold);
  border: 1px solid #d5a85633;
  background: radial-gradient(circle, #c08b242b, #291b21);
  box-shadow: 0 0 22px #e24c3d10;
}
.chart-tooltip {
  color: #ffefd5;
  background: #2a1721;
  border: 1px solid #b4824966;
  box-shadow: 0 4px 22px #0008;
}
.day-pill {
  background: #171218;
  border-color: #5d3d4d3b;
}
.day-pill.logged {
  color: var(--gold-bright);
  background: linear-gradient(150deg, #402024, #22141d);
  border-color: #f0486350;
}
.day-pill.logged .day-status {
  background: var(--gold);
  color: #291a10;
  box-shadow: 0 0 9px #e9b84f2e;
}
.day-pill.today {
  border-color: var(--gold);
  box-shadow: 0 0 16px #e4b6461a;
}
.day-pill:hover {
  border-color: #e5b967;
}
.week-insights {
  border-color: #af875526;
}
.week-insights strong {
  color: #edcca0;
}
th {
  color: #c6aa83;
  background: #1d151b;
}
td, th {
  border-color: #3c2a33;
}
.table-date > span {
  color: var(--gold);
  background: #34251b;
}
.table-date strong {
  color: #dbcdd6;
}
.mood-tag {
  color: var(--gold);
  background: #332519;
}
.row-actions .icon-button:hover {
  color: #ff7a8e;
  background: #3c1b28;
}
.page-footer {
  color: #a3919b;
}
.status-banner.demo {
  background: #292013;
  border-color: #9e754141;
  color: #e7c48c;
}
.status-banner.error {
  background: #31151e;
  border-color: #99324670;
  color: #ffb1bd;
}
dialog {
  background: linear-gradient(145deg, #1e141c, #120d13);
  border-color: #ae805b55;
  box-shadow: 0 0 55px #ea36501c, 0 32px 110px #000c;
}
dialog::backdrop {
  background: #000000b5;
  backdrop-filter: blur(7px);
}
.dialog-footer {
  background: #160f16f5;
  border-color: #78513543;
  backdrop-filter: blur(12px);
}
.dialog-heading h2 {
  color: #ffe9d0;
}
input:not([type=radio]), textarea {
  color: #f3e7ee;
  background: #150f16;
  border-color: #523b4a;
}
input:focus, textarea:focus {
  background: #21151f;
  border-color: var(--gold);
  box-shadow: 0 0 14px #dfa93c12;
}
.field .icon {
  color: var(--gold);
}
.mood-options label > span {
  background: #1b121b;
  border-color: #523b46;
}
.mood-options input:checked + span {
  color: var(--gold-bright);
  background: #3b281b;
  border-color: var(--gold);
  box-shadow: 0 0 13px #ecb8461a;
}
.mood-options input:focus-visible + span {
  outline-color: var(--gold);
}
.form-error {
  background: #341622;
  color: #ffb6c2;
  border: 1px solid #a73c4c4d;
}
.toast {
  background: #2a1c1c;
  color: #ffe2b0;
  border-color: #b18d4c;
  box-shadow: 0 0 25px #e23a481b, 0 12px 24px #0005;
}
.week-editor input:disabled {
  background: #171117;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline-color: var(--gold);
}
@media (max-width: 540px) {
  .sidebar {
    background: #0e0a11f5;
    border-top-color: #b589423d;
    box-shadow: 0 -8px 26px #0006;
  }
  .nav-item.active {
    color: var(--gold);
    border-color: transparent;
    box-shadow: inset 0 2px 0 var(--ruby);
    background: linear-gradient(#60243329, transparent);
  }
}

/* Static edition: browser storage and portable backups. */
.backup-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; margin: 0 0 23px; border: 1px solid #aa824128; background: #21180e66; border-radius: 12px; }
.backup-bar > span { display: flex; align-items: center; gap: 7px; color: #b9a184; font-size: 13px; }
.backup-bar > span .icon { width: 16px; height: 16px; color: #e5b965; }
.backup-actions { display: flex; gap: 8px; }
.backup-actions .button { padding: 6px 12px; min-height: 34px; font-size: 12px; }
#import-dialog .dialog-footer .primary { flex: initial; }
@media (max-width: 760px) { .backup-bar { align-items: stretch; flex-direction: column; gap: 10px; } .backup-actions .button { flex: 1; } }
