/* DuceOne: Klein blue, mint for state, Familjen Grotesk.
   Mint marks what is on now, what is active and what is done. It never
   colours single words in running text. Two themes, switchable: blue and white. */

@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/familjen-grotesk-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/familjen-grotesk-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- the two themes */

:root {
  --sans: 'Familjen Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --serif: var(--sans);
  --klein: #002fa7;
  --mark: #8ff0c4;
  --mark-ink: #002fa7;
}

html[data-theme='blau'] {
  color-scheme: dark;
  --bg: #002fa7;
  --fg: #ffffff;
  --mute: #c3cff5;
  --rule: #3358c4;
  --card: #1a45b8;
  --edge: #6c88dc;
  --head: #ffffff;
  --now: #8ff0c4;
  --focus: #ffffff;
  --act-bg: #8ff0c4;
  --act-fg: #002fa7;
  --solid-bg: #ffffff;
  --solid-fg: #002fa7;
  --chip-edge: transparent;
  --count-bg: transparent;
  --count-fg: #8ff0c4;
  --bar-done: #ffffff;
  --line-c: #ffffff;
  --fab-bg: #ffffff;
  --fab-fg: #002fa7;
  --nav-bg: #002fa7;
  --nav-rule: #3358c4;
  --nav-on-bg: #1a45b8;
  --nav-on-fg: #8ff0c4;
  --switch-bg: #1a45b8;

  /* the Content area keeps its own stylesheet; these are its colours here */
  --paper: #002fa7;
  --surface: #1a45b8;
  --soft: #2550c4;
  --ink: #ffffff;
  --muted: #c3cff5;
  --line: #4a6bd0;
  --accent: #8ff0c4;
  --accent-ink: #002fa7;
  --accent-soft: #2a56c9;
  --warn: #ffe08a;
  --warn-soft: #2550c4;
  --ok: #8ff0c4;
}

html[data-theme='weiss'],
.d-sheet {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0b1030;
  --mute: #5a5f73;
  --rule: #e2e5f0;
  --card: #eef2fc;
  --edge: #9aa6d6;
  --head: #002fa7;
  --now: #002fa7;
  --focus: #002fa7;
  --act-bg: #002fa7;
  --act-fg: #ffffff;
  --solid-bg: #002fa7;
  --solid-fg: #ffffff;
  --chip-edge: #002fa7;
  --count-bg: #8ff0c4;
  --count-fg: #0b1030;
  --bar-done: #9aa6d6;
  --line-c: #002fa7;
  --fab-bg: #8ff0c4;
  --fab-fg: #002fa7;
  --nav-bg: #eef2fc;
  --nav-rule: #002fa7;
  --nav-on-bg: #8ff0c4;
  --nav-on-fg: #0b1030;
  --switch-bg: #dbe2f6;
}

html[data-theme='weiss'] {
  --paper: #ffffff;
  --surface: #f5f7fc;
  --soft: #eef2fc;
  --ink: #0b1030;
  --muted: #5a5f73;
  --line: #d3d9ee;
  --accent: #002fa7;
  --accent-ink: #ffffff;
  --accent-soft: #e3e9fb;
  --warn: #8a5a00;
  --warn-soft: #f7ecd2;
  --ok: #1f6b4f;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.d-app :focus-visible,
.d-sheet :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- frame: phone first */

.d-app {
  min-height: 100dvh;
}

.d-main {
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 24px calc(env(safe-area-inset-bottom) + 124px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.d-wait {
  padding: 40vh 24px 0;
  text-align: center;
  color: var(--mute);
  font-size: 17px;
}

.d-word {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.31em;
  font: 700 30px/1 var(--sans);
  letter-spacing: -0.02em;
  color: var(--head);
}

/* The mark next to the name, in the proportions of the logo files. */
.d-mark {
  flex: none;
  width: 1.374em;
  height: 0.884em;
}

.d-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  box-sizing: border-box;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 10px);
  background: var(--bg);
  border-top: 2px solid var(--nav-rule);
}

.d-nav .d-word,
.d-nav-foot {
  display: none;
}

.d-nav-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.d-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 52px;
  border: 0;
  background: none;
  color: var(--mute);
  font: 500 13px/1 var(--sans);
  cursor: pointer;
}

.d-nav-item.on {
  color: var(--now);
  font-weight: 700;
}

.d-badge {
  position: absolute;
  top: 0;
  left: calc(50% + 6px);
  box-sizing: border-box;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--mark);
  color: var(--mark-ink);
  font: 700 13px/20px var(--sans);
  text-align: center;
}

.d-nav-item .live-dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 10px);
  margin: 0;
}

.d-fab {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom) + 98px);
  z-index: 6;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 20px;
  background: var(--fab-bg);
  color: var(--fab-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 10, 60, 0.28);
}

.toast {
  bottom: calc(env(safe-area-inset-bottom) + 100px);
  font-weight: 600;
}

/* ---------- buttons */

.b-act,
.b-solid,
.b-ghost,
.b-text {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  font: 700 17px/1.1 var(--sans);
  cursor: pointer;
}

.b-act {
  background: var(--act-bg);
  color: var(--act-fg);
}

.b-solid {
  background: var(--solid-bg);
  color: var(--solid-fg);
}

.b-solid.on {
  outline: 3px solid var(--mark);
  outline-offset: 2px;
}

.b-ghost {
  background: transparent;
  color: var(--head);
  border-color: currentColor;
  font-weight: 600;
}

/* A rimmed button that is switched on, like the chosen part of a switch. */
.b-ghost.on {
  border-color: transparent;
  background: var(--solid-bg);
  color: var(--solid-fg);
}

/* The quiet alternative: a small button with a rim. Nothing to tap is ever an underlined word. */
.b-text {
  min-height: 44px;
  padding: 0 16px;
  background: none;
  border-color: var(--edge);
  color: var(--head);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.big {
  min-height: 62px;
  padding: 0 26px;
  border-radius: 18px;
  font-size: 21px;
}

.small {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 15px;
}

.wide {
  width: 100%;
}

.grow {
  flex: 1;
}

.d-app button:disabled,
.d-sheet button:disabled {
  opacity: 0.6;
  cursor: default;
}

.working {
  animation: blink 1.2s infinite;
}

/* ---------- heads, lists, cards */

.d-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.d-head h1 {
  flex: 1;
  margin: 0;
  font: 700 34px/1.05 var(--sans);
  letter-spacing: -0.02em;
  color: var(--head);
}

.d-more {
  flex: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--head);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.d-count {
  flex: none;
  margin: 0;
  padding: 5px 12px;
  border-radius: 9px;
  background: var(--count-bg);
  color: var(--count-fg);
  font: 700 16px/1.2 var(--sans);
}

.d-sub,
.d-hint {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--mute);
}

.d-hint.strong {
  color: var(--head);
  font-weight: 600;
}

.d-hint.hidden {
  display: none;
}

.center {
  text-align: center;
}

.d-now {
  margin: 0;
  font: 700 16px/1.2 var(--sans);
  color: var(--now);
}

.d-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.d-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.d-row.wrap {
  flex-wrap: wrap;
}

.d-row > .d-field {
  flex: 1 1 140px;
}

.d-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.d-list > li {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--rule);
}

.d-list.plain > li,
.d-list.cards > li,
.d-list.boxed > li {
  border: 0;
}

.d-list.cards,
.d-list.boxed {
  gap: 6px;
}

.d-item {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cards .d-item,
.boxed .d-item {
  padding: 10px 14px;
  border-radius: 14px;
}

.cards .d-item {
  background: var(--card);
}

.boxed .d-item {
  border: 1.5px solid var(--rule);
}

.plain .d-item {
  padding: 6px 0;
}

.d-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.d-item-title {
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.d-item-step {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 500;
}

.d-item-meta {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--mute);
}

.d-num {
  flex: none;
  min-width: 1ch;
  font-size: 16px;
  font-weight: 700;
  color: var(--mute);
}

.d-day.today li:first-child .d-num {
  color: var(--now);
}

.d-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.d-card > h2:not([class]) {
  margin: 0;
  font: 600 16px/1.2 var(--sans);
  color: var(--mute);
}

.d-card-title,
.d-clarify-title {
  margin: 0;
  font: 700 22px/1.15 var(--sans);
  letter-spacing: -0.01em;
  color: var(--head);
  overflow-wrap: anywhere;
}

.d-card-line {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.d-card-line .d-card-title {
  font-size: 19px;
}

.d-figure {
  margin: 0;
  font: 700 56px/0.95 var(--sans);
  letter-spacing: -0.03em;
}

.d-figure.mark {
  color: var(--now);
}

.d-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.d-empty {
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.d-empty h2 {
  margin: 0;
  font: 700 28px/1.1 var(--sans);
  letter-spacing: -0.015em;
  color: var(--head);
}

.d-empty p {
  margin: 0;
  max-width: 40ch;
  font-size: 17px;
  color: var(--mute);
}

.d-day {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.d-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.d-day-head h2 {
  margin: 0;
  font: 700 17px/1.2 var(--sans);
  color: var(--head);
}

.d-day.today .d-day-head h2 {
  color: var(--now);
}

.d-day-head p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--mute);
}

.d-more-list summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--mute);
  cursor: pointer;
}

/* ---------- Heute */

.d-overview {
  display: none;
}

.d-focus {
  min-height: calc(100dvh - 204px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.d-focus-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-focus-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.d-bars {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
}

.d-bars span {
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
}

.d-bars .done {
  background: var(--bar-done);
}

.d-bars .now {
  background: var(--now);
}

.d-date {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--mute);
}

.d-focus-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
}

.d-task {
  margin: 0;
  font: 700 clamp(38px, 11.5vw, 50px) / 1.03 var(--sans);
  letter-spacing: -0.025em;
  color: var(--head);
  overflow-wrap: anywhere;
  hyphens: auto;
  text-wrap: balance;
}

.d-meta,
.d-note {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--mute);
}

.d-note {
  white-space: pre-line;
}

.d-actions {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.d-actions .b-act {
  flex: 1;
}

.d-focus-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--mute);
}

.d-focus-foot p {
  margin: 0 0 4px;
}

.d-hintline {
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 16px;
  border: 2px solid var(--edge);
  border-radius: 14px;
  background: none;
  color: var(--head);
  font: 600 16px/1.25 var(--sans);
  text-align: left;
  cursor: pointer;
}

/* ---------- Eingang */

.d-clarify {
  gap: 16px;
}

.d-clarify-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.d-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-label {
  margin: 0;
  font: 600 14px/1.2 var(--sans);
  color: var(--mute);
}

.d-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.d-chip {
  height: 44px;
  padding: 0 14px;
  border: 2px solid var(--edge);
  border-radius: 12px;
  background: transparent;
  color: var(--head);
  font: 600 16px/1 var(--sans);
  cursor: pointer;
}

.d-chip.on {
  border-color: var(--chip-edge);
  background: var(--mark);
  color: var(--mark-ink);
  font-weight: 700;
}

.d-pots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.d-pots button {
  min-height: 52px;
  padding: 0 8px;
}

/* ---------- forms */

.d-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.d-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font: 600 14px/1.2 var(--sans);
  color: var(--mute);
}

.d-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 11px 14px;
  border: 2px solid var(--edge);
  border-radius: 14px;
  background-color: transparent;
  color: var(--fg);
  font: 500 17px/1.3 var(--sans);
}

textarea.d-input {
  display: block;
  resize: vertical;
}

.d-input::placeholder {
  color: var(--mute);
  opacity: 1;
}

.d-input:focus {
  border-color: var(--focus);
}

/* The field while the app listens: the state colour shows that the microphone is on. */
.d-input.hearing {
  border-color: var(--now);
}

.d-input.hearing::placeholder {
  color: var(--fg);
}

.d-alert {
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card);
  font-weight: 600;
}

.d-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--switch-bg);
}

.d-switch button {
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--head);
  font: 600 16px/1 var(--sans);
  cursor: pointer;
}

.d-switch button.on {
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-weight: 700;
}

/* ---------- settings: the second sign-in step */

.d-security {
  align-items: flex-start;
}

.d-steps-text {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
}

.d-qr {
  padding: 8px;
  border: 2px solid var(--edge);
  border-radius: 12px;
  background: #ffffff;
}

.d-codes {
  align-self: stretch;
  margin: 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  font: 15px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  columns: 2;
  column-gap: 32px;
}

.d-security code {
  font: 600 15px ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--fg);
  overflow-wrap: anywhere;
}

/* ---------- sheets */

.d-sheet {
  box-sizing: border-box;
  width: 100%;
  max-width: min(560px, 100%);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 18px 24px calc(env(safe-area-inset-bottom) + 26px);
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  overflow: auto;
}

.d-sheet::backdrop {
  background: rgba(0, 12, 60, 0.6);
}

.d-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.d-sheet-head h2 {
  margin: 0;
  font: 700 26px/1.1 var(--sans);
  letter-spacing: -0.015em;
  color: var(--head);
}

/* ---------- Erfolge and review */

.d-hero {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.d-hero-num {
  margin: 0;
  font: 700 136px/0.8 var(--sans);
  letter-spacing: -0.04em;
  color: var(--now);
}

.d-hero-text {
  margin: 0 0 2px;
  font: 700 26px/1.05 var(--sans);
  letter-spacing: -0.015em;
}

.d-chart {
  display: block;
  width: 100%;
  max-width: 440px;
  height: auto;
}

.d-chart .area {
  fill: var(--card);
}

.d-chart .line {
  fill: none;
  stroke: var(--line-c);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.d-chart .dot {
  fill: var(--bg);
  stroke: var(--line-c);
  stroke-width: 2;
}

.d-chart .dot.last {
  fill: var(--mark);
  stroke-width: 2.5;
}

.d-chart .tick {
  font: 500 14px var(--sans);
  fill: var(--mute);
}

.d-chart .tick.today {
  font-weight: 700;
  fill: var(--fg);
}

.d-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.d-steps li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.d-steps li.now {
  margin: 0 -14px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--card);
}

.d-step-mark {
  flex: none;
  box-sizing: border-box;
  width: 26px;
  height: 26px;
  border: 2px solid var(--edge);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.d-steps li.done .d-step-mark {
  border-color: var(--mark);
  background: var(--mark);
  color: var(--mark-ink);
}

.d-steps .d-item-text {
  flex: 1 1 150px;
}

.d-steps li.now .d-step-mark {
  border-width: 2.5px;
  border-color: var(--now);
}

/* ---------- check-ins */

.d-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.d-scale .d-chip {
  height: 52px;
  padding: 0;
  font-size: 19px;
}

.d-scale-ends {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--mute);
}

.d-strain {
  max-width: 34ch;
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}

.d-list.d-feel > li {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 0;
}

.d-feel-head {
  font-size: 16px;
  font-weight: 700;
}

.d-meters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.d-meter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
}

.d-meter-bars {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
}

.d-meter-bars span {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  background: var(--rule);
}

.d-meter-bars span.on {
  background: var(--fg);
}

/* ---------- sign-in */

.d-app.signin {
  display: grid;
  place-items: center;
  padding: 24px;
}

.d-signin {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.d-signin h1 {
  margin: 12px 0 0;
  font: 700 40px/1 var(--sans);
  letter-spacing: -0.025em;
  color: var(--head);
}

/* ---------- the Content area inside the shell */

.area-content .d-head {
  flex-wrap: wrap;
}

.d-main > .view {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ---------- the day: its rail, its steps, its rhythm */

.d-focus-top .d-date {
  flex: 1;
}

.d-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font: 500 14px/1.2 var(--sans);
  color: var(--mute);
}

.d-rail li {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.d-rail .bar {
  height: 6px;
  border-radius: 3px;
  background: var(--rule);
}

.d-rail li.done {
  color: var(--fg);
}

.d-rail li.done .bar {
  background: var(--bar-done);
}

.d-rail li.now {
  color: var(--now);
  font-weight: 700;
}

.d-rail li.now .bar {
  background: var(--now);
}

.d-daysteps {
  align-self: stretch;
  list-style: none;
  margin: 0;
  padding: 4px 18px;
  border-radius: 20px;
  background: var(--card);
  display: flex;
  flex-direction: column;
}

.d-daysteps li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.d-daysteps li:last-child {
  border-bottom: 0;
}

.d-daysteps .d-item-title {
  flex: 1;
}

.d-daysteps li:first-child .d-num {
  color: var(--now);
}

.d-rhythm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-rhythm-days {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  font: 500 13px/1.2 var(--sans);
  color: var(--mute);
  text-align: center;
}

.d-rhythm-days > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.d-rhythm-days span {
  height: 8px;
  border-radius: 4px;
  background: var(--rule);
}

.d-card .d-rhythm-days span {
  background: var(--edge);
}

.d-rhythm-days span.on {
  background: var(--bar-done);
}

.d-rhythm-days .today {
  color: var(--fg);
  font-weight: 700;
}

.d-rhythm-days .today span.on {
  background: var(--now);
}

.d-task.mark {
  color: var(--now);
}

.d-lead {
  margin: 0;
  font: 600 22px/1.25 var(--sans);
}

/* ---------- the guided start and close: one thing at a time */

.d-flow {
  max-width: 560px;
  min-height: 100dvh;
  padding-bottom: calc(env(safe-area-inset-bottom) + 34px);
  gap: 20px;
}

.d-flow-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.d-flow-title {
  flex: 1;
  margin: 0;
  font: 700 16px/1.2 var(--sans);
}

.d-flow-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.d-flow-h {
  margin: 0;
  font: 700 clamp(32px, 9vw, 40px) / 1.05 var(--sans);
  letter-spacing: -0.02em;
  color: var(--head);
}

.d-picks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-pick {
  width: 100%;
  min-height: 60px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 2px solid var(--rule);
  border-radius: 16px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.d-pick.on {
  border-color: var(--now);
  background: var(--card);
}

.d-pick-mark {
  flex: none;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  border: 2px solid var(--edge);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 16px/1 var(--sans);
}

.d-pick.on .d-pick-mark {
  border-color: var(--mark);
  background: var(--mark);
  color: var(--mark-ink);
}

.d-list > li.d-line {
  padding: 12px 0;
}

.d-row.spread {
  justify-content: space-between;
}

.b-text.center {
  align-self: center;
}

/* ---------- the settings page */

.d-set {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-set > h2 {
  margin: 0;
  font: 700 14px/1.2 var(--sans);
  color: var(--now);
}

.d-set-body {
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.d-set-body > .b-ghost {
  align-self: flex-start;
  text-decoration: none;
}

.d-set-body .d-switch,
.d-set-body .d-alert,
.d-set-body .d-codes {
  background: var(--bg);
}

.d-switch.n3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Five lists share the width of a phone: shorter words, the same switch. */
.d-switch.n5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}

.d-switch.n5 button {
  padding: 0;
  font-size: 14px;
}

.d-switch button {
  position: relative;
}

/* In the corner of its tab, so it takes no width from the word. */
.d-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mark);
}

.d-switch button.on .d-dot {
  background: currentColor;
}

.d-row.start {
  align-items: flex-start;
}

.d-set-body .d-field > .b-solid {
  align-self: flex-start;
}

.d-steps {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
}

/* ---------- help */

.d-head-slot {
  flex: none;
  display: flex;
}

.d-guide {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- what was understood from the day's close */

.d-heard {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
}

.d-heard > summary {
  cursor: pointer;
  font: 600 14px/1.2 var(--sans);
  color: var(--mute);
}

.d-heard > p {
  margin: 10px 0 0;
  font-size: 16px;
}

/* ---------- the third form: a whole row or tile that leads somewhere, marked with an arrow */

.d-go {
  width: 100%;
  min-height: 60px;
  box-sizing: border-box;
  padding: 12px 16px 12px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.d-go-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.d-go-title {
  font: 600 18px/1.25 var(--sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d-go-meta {
  font: 500 14px/1.2 var(--sans);
  color: var(--mute);
}

/* Some things show only where there is room for them, others only where the bar has none. */
.wide-only {
  display: none;
}

/* The day's proposal lists its tasks; they are not for tapping there. */
.d-pick.still {
  cursor: default;
}

/* The exchange behind the plus: it scrolls inside its sheet. */
.d-chat.in-sheet {
  max-height: 46dvh;
  overflow-y: auto;
  margin-bottom: 14px;
  padding-bottom: 0;
}

.d-chat.in-sheet:empty {
  display: none;
}

/* Posts and knowledge put their pages straight into the page's column. */
.d-content {
  display: contents;
}

textarea.d-post-text {
  min-height: 220px;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
}

.d-script {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.d-go.working {
  opacity: 0.6;
}

/* Every list is a column of such rows. */
.d-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-go .d-num {
  align-self: flex-start;
  padding-top: 2px;
}

/* Inside a card the row needs a ground of its own. */
.d-card .d-go {
  background: var(--bg);
}

div.d-go {
  cursor: default;
}

.d-step.done .d-step-mark {
  border-color: var(--mark);
  background: var(--mark);
  color: var(--mark-ink);
}

.d-step.now .d-step-mark {
  border-width: 2.5px;
  border-color: var(--now);
}

/* A long text may take the lines it needs. */
.d-go.wrap .d-go-title {
  white-space: normal;
}

/* Name on the left, where things stand on the right. */
.d-go.side > .d-go-title {
  flex: 1;
  min-width: 0;
}

.d-go.side > .d-go-meta {
  flex: none;
  max-width: 58%;
  font-size: 15px;
  text-align: right;
}

.d-stack.tight {
  gap: 8px;
}

/* Two alternatives side by side, never more. */
.d-pairrow {
  align-self: stretch;
  display: flex;
  gap: 10px;
}

.d-pairrow > * {
  flex: 1 1 0;
  min-width: 0;
}

.d-pairrow:empty {
  display: none;
}

/* Taking back what the assistant just changed: under its answer, on its side of the talk. */
.d-undo {
  display: flex;
  justify-content: flex-start;
}

/* Two side by side have half the width each: the word has to fit on one line. */
.d-pairrow > .big {
  padding: 0 10px;
  font-size: 18px;
}

.d-go > .d-icon,
.d-tile-head > .d-icon {
  flex: none;
  color: var(--mute);
}

.d-tile {
  border: 0;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.d-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 600 16px/1.2 var(--sans);
  color: var(--mute);
}

.d-tile-hint {
  font: 500 14px/1.2 var(--sans);
  color: var(--mute);
}

/* The other ways, folded away behind a rimmed button while a proposal is on the table. */
.d-other {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.d-other > summary {
  list-style: none;
  min-height: 56px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 2px solid var(--edge);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 18px/1.2 var(--sans);
  color: var(--head);
  cursor: pointer;
}

.d-other > summary::-webkit-details-marker {
  display: none;
}

.d-other[open] > summary {
  margin-bottom: 12px;
}

/* ---------- what the assistant says inside a screen */

.d-says,
.d-offer {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.d-says p,
.d-offer p {
  margin: 0;
  font: 500 17px/1.35 var(--sans);
}

.d-says .d-says-label,
.d-offer .d-says-label {
  font: 700 14px/1.2 var(--sans);
  color: var(--now);
}

.d-offer {
  gap: 10px;
}

.d-offer ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 500 16px/1.35 var(--sans);
}

/* ---------- the conversation with the assistant */

.d-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 8px;
}

.d-chat-h {
  margin: 8px 0 0;
  font: 700 30px/1.1 var(--sans);
  letter-spacing: -0.02em;
  color: var(--head);
}

.d-bub {
  margin: 0;
  max-width: 88%;
  padding: 12px 16px;
  font: 500 17px/1.4 var(--sans);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.d-bub.me {
  align-self: flex-end;
  border-radius: 20px 20px 6px 20px;
  background: var(--solid-bg);
  color: var(--solid-fg);
  font-weight: 600;
}

.d-bub.it {
  align-self: flex-start;
  border-radius: 20px 20px 20px 6px;
  background: var(--card);
}

.d-bub.wait {
  color: var(--mute);
}

/* Something was stored: a state, so it carries the state colour. */
.d-bub.note {
  align-self: stretch;
  max-width: none;
  padding: 0 4px;
  font: 600 15px/1.35 var(--sans);
  color: var(--now);
}

/* The field stays in reach above the bar while the talk scrolls behind it. */
.d-ask {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 0 6px;
  background: var(--bg);
  /* Nothing of the talk shows through between the field and the bar below it. */
  box-shadow: 0 48px 0 var(--bg);
}

.d-ask textarea {
  flex: 1;
  min-height: 52px;
  max-height: 160px;
  box-sizing: border-box;
  padding: 13px 18px;
  border-radius: 26px;
  resize: none;
}

.d-send {
  flex: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--act-bg);
  color: var(--act-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.d-ask.hidden {
  display: none;
}

.d-speak {
  flex: none;
  width: 52px;
  height: 52px;
  box-sizing: border-box;
  border: 2px solid var(--edge);
  border-radius: 50%;
  background: none;
  color: var(--head);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* The conversation aloud takes the place of the field: what the app is doing, and two buttons. */
.d-voice:empty {
  display: none;
}

.d-voice {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  z-index: 2;
  background: var(--bg);
  box-shadow: 0 48px 0 var(--bg);
  padding: 10px 0 6px;
}

.d-voicebar {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.d-voicebar.type {
  margin-bottom: 4px;
}

.d-voice-state {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 600 18px/1.3 var(--sans);
}

/* The state colour shows that it is the app's turn or his: lit while it listens. */
.d-voice-dot {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--edge);
}

.d-voicebar.listen .d-voice-dot {
  background: var(--now);
}

.d-voice-heard {
  margin: 0;
  font: 500 17px/1.35 var(--sans);
  color: var(--mute);
}

.d-voicebar .d-row > * {
  flex: 1;
}

/* ---------- settings: what the assistant may see */

.d-may {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.d-may-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.d-may-name {
  font: 600 17px/1.2 var(--sans);
}

.d-may-hint,
.d-may-fixed {
  font: 500 14px/1.2 var(--sans);
  color: var(--mute);
}

.d-may .d-switch {
  flex: none;
  width: 132px;
}

.d-may .d-switch button {
  height: 38px;
}

/* ---------- capturing sits in the middle of the bar on a phone */

.d-nav-capture {
  justify-self: center;
  align-self: center;
  width: 58px;
  height: 50px;
  border: 0;
  border-radius: 17px;
  background: var(--fab-bg);
  color: var(--fab-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
}

/* ---------- wide screens: the navigation becomes a side column */

@media (min-width: 700px) {
  .d-sheet {
    margin: auto;
    border-radius: 28px;
  }
}

@media (min-width: 900px) {
  .d-app:not(.signin) {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
  }

  .d-nav {
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 36px 20px 28px;
    border-top: 0;
    border-right: 2px solid var(--rule);
    background: var(--nav-bg);
    display: flex;
    flex-direction: column;
    gap: 28px;
  }

  html[data-theme='weiss'] .d-nav {
    border-right-color: transparent;
  }

  .d-nav .d-word {
    display: flex;
    margin-left: 12px;
  }

  .d-nav-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .d-nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--fg);
    font-size: 18px;
  }

  .d-nav-item.on {
    background: var(--nav-on-bg);
    color: var(--nav-on-fg);
  }

  .d-badge,
  .d-nav-item .live-dot {
    position: static;
    margin-left: auto;
  }

  .d-nav-foot {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
  }

  .d-fab,
  .d-more,
  .d-nav-capture,
  .d-focus .d-rhythm {
    display: none;
  }

  .d-app.flow {
    display: block;
  }

  .d-nav-foot {
    gap: 8px;
  }

  .d-nav-item.wide-only {
    display: flex;
  }

  .narrow-only {
    display: none;
  }

  .toast {
    bottom: 28px;
  }

  .d-main {
    max-width: 760px;
    padding: 44px 48px 64px;
  }

  .area-heute .d-main,
  .area-content .d-main {
    max-width: 1180px;
  }

  .d-heute-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 48px;
    align-items: start;
  }

  .d-focus {
    min-height: calc(100dvh - 108px);
  }

  .d-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .d-focus-foot {
    padding-right: 0;
  }

  .d-focus-foot .d-hintline:not(.keep) {
    display: none;
  }

  .d-task {
    max-width: 14em;
    font-size: clamp(48px, 5.2vw, 76px);
    line-height: 1;
  }

}

@media (prefers-reduced-motion: reduce) {
  .working {
    animation: none;
  }
}
