/* Page chrome comes from /ui/shell.css. Keep this sheet transparent so the
   fixed art and overlay stay visible, and map colours onto the kit tokens. */
body.dx {
  background: transparent;
  color: var(--dx-text);
  font-family: var(--dx-font);
}

main {
  background: transparent;
  color: var(--dx-text);
  font-family: var(--dx-font);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.dx-header .dx-title {
  flex: 0 1 auto;
  min-width: 0;
}

.dx-header .dx-actions {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.dx-header .dong-theme-toggle {
  position: static;
  top: auto;
  right: auto;
  flex: none;
  width: 44px;
  height: 44px;
}

.dx-header .dong-theme-toggle__knob {
  top: 11px;
}

#sync {
  margin: 0;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--dx-muted);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

a.log-link {
  width: 100%;
  margin-top: 4px;
  background: var(--dx-accent);
  color: var(--dx-accent-fg);
  border-radius: var(--dx-radius-sm);
  font-family: var(--dx-font);
}

.dx-card:empty {
  display: none;
}

section {
  margin-top: var(--dx-gap);
  min-width: 0;
}

.dx-card {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--dx-text);
}

section h2,
#log h2 {
  font-family: var(--dx-font);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  line-height: 1.3;
  color: var(--dx-text);
}

section p {
  margin: 0;
}

.card {
  background: var(--dx-card);
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius);
  padding: var(--dx-gap);
  color: var(--dx-text);
}

.dx-card > .card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.dx-card > .card + .card {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--dx-border);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
}

.stat {
  min-width: 0;
}

.stat .label,
.stat > :first-child:not(:last-child) {
  color: var(--dx-muted);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.3;
}

.stat .value,
.stat > :last-child {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--dx-text);
}

.stats + .bar {
  margin-top: 0.75rem;
}

.bar {
  background: var(--dx-border);
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  height: 100%;
  background: var(--dx-accent);
  border-radius: 99px;
  display: block;
}

.heat {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  gap: 3px;
  width: 100%;
}

.heat i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--dx-accent);
  display: block;
  min-width: 0;
}

.heat i.off {
  opacity: 0.12;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  margin-bottom: 3px;
  font-size: 0.65rem;
  line-height: 1;
  color: var(--dx-muted);
  text-align: center;
}

.muted {
  color: var(--dx-muted);
  line-height: 1.4;
}

ol.tasks {
  padding-left: 1.1rem;
  margin: 0.4rem 0 0;
}

ol.tasks li + li {
  margin-top: 0.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  background: var(--dx-card-solid);
  color: var(--dx-text);
  border: 1px solid var(--dx-border);
  margin-left: 0.35rem;
}

svg.chart {
  width: 100%;
  height: 72px;
  display: block;
  color: var(--dx-accent);
}

svg.chart polyline,
svg.chart path {
  fill: none;
  stroke: currentColor;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.35rem 0;
  min-width: 0;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

.dx-card a:not(.dx-btn) {
  color: var(--dx-accent);
}

.insight {
  padding: 0.45rem 0;
  border-top: 1px solid var(--dx-border);
  line-height: 1.4;
}

.demo-banner,
.format-banner {
  margin: var(--dx-gap) 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--dx-radius);
  border: 1px solid var(--dx-border);
  background: var(--dx-card);
  color: var(--dx-text);
  font-weight: 600;
  line-height: 1.4;
}

.format-banner {
  background: #9f1239;
  color: #ffffff;
  border-color: transparent;
}

#log .log-back {
  margin: var(--dx-gap) 0 0;
}

#log .log-back a {
  text-decoration: none;
  background: var(--dx-card);
  color: var(--dx-text);
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius-sm);
  font-family: var(--dx-font);
}

#log h2 {
  margin-top: 0;
}

#log-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: var(--dx-gap);
}

#log-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dx-text);
}

#log-form input,
#log-form select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius-sm);
  background: var(--dx-card-solid);
  color: var(--dx-text);
  font-family: var(--dx-font);
  font-size: 1rem;
  font-weight: 400;
}

#log-form input:disabled,
#log-form select:disabled {
  opacity: 0.65;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips button,
.log-actions button,
.log-row-actions button {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-radius-sm);
  background: var(--dx-card-solid);
  color: var(--dx-text);
  font-family: var(--dx-font);
  font-weight: 600;
  cursor: pointer;
}

.chips button[aria-pressed="true"] {
  background: var(--dx-accent);
  color: var(--dx-accent-fg);
  border-color: transparent;
}

.log-error {
  margin: 0;
  color: #9f1239;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

html.dark .log-error {
  color: #fecdd3;
}

.log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

#log-save {
  flex: 1 1 8rem;
  background: var(--dx-accent);
  color: var(--dx-accent-fg);
  border-color: transparent;
}

#log-summary,
#log-list {
  min-width: 0;
  margin-top: var(--dx-gap);
}

#log-list > h2 {
  margin-top: 1rem;
}

#log-list > h2:first-child {
  margin-top: 0;
}

.log-total {
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dx-text);
}

.log-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  min-width: 0;
}

.log-row + .log-row {
  border-top: 1px solid var(--dx-border);
}

.log-row-text {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.log-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--dx-accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}
