:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1A77CE;
  --soft: #eef2f7;
  --danger: #b91c1c;
  --ok: #166534;
  --warn: #92400e;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-height: 100%;
  font: 16px/1.45 Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app-logo {
  display: block;
  width: auto;
  height: 32px;
}
button,
input,
textarea {
  font: inherit;
}
.hidden {
  display: none !important;
}
.app {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 16px 104px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.brand {
  font-weight: 850;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.date {
  font-size: 14px;
  color: var(--muted);
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 2px 12px rgba(17, 24, 39, 0.04);
}
.capture {
  padding: 20px;
}
.capture h1 {
  font-size: 27px;
  line-height: 1.1;
  margin: 0 0 8px;
}
.capture p {
  margin: 0 0 18px;
  color: var(--muted);
}
.micWrap {
  display: flex;
  gap: 10px;
  align-items: center;
}
.mic {
  flex: 1;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 760;
  cursor: pointer;
}
.mic.rec {
  background: var(--danger);
}
.secondary {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  margin-top: 12px;
  min-height: 92px;
  resize: vertical;
}
.status {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}
.status.error {
  color: var(--danger);
}
.status.ok {
  color: var(--ok);
}
.sectionTitle {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 24px 2px 10px;
}
.sectionTitle h2 {
  margin: 0;
  font-size: 18px;
}
.entry {
  display: grid;
  grid-template-columns: 115px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.entry:last-child {
  border-bottom: 0;
}
.entry:hover {
  background: #fafafa;
}
.time {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--muted);
}
.client {
  font-weight: 780;
}
.topic {
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}
.desc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.dur {
  font-weight: 730;
  font-size: 14px;
  white-space: nowrap;
}
.empty {
  padding: 30px 8px;
  color: var(--muted);
  text-align: center;
}
.summary {
  margin-top: 12px;
}
.sumrow {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
}
.sumrow + .sumrow {
  border-top: 1px solid var(--line);
}
.sumrow.total {
  font-weight: 800;
}
.nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(880px, calc(100% - 24px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.12);
  z-index: 20;
}
.nav button {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 11px 6px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.nav button.active {
  background: var(--soft);
  color: var(--text);
}
.view {
  display: none;
}
.view.active {
  display: block;
}
.periodHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.periodHead h1 {
  font-size: 24px;
  margin: 0;
}
.periodControls {
  display: flex;
  gap: 8px;
}
.iconBtn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}
.dataWrap {
  overflow: auto;
}
.dataTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}
.dataTable th,
.dataTable td {
  text-align: right;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
}
.dataTable th:first-child,
.dataTable td:first-child {
  text-align: left;
}
.dataTable th {
  color: var(--muted);
  font-weight: 600;
}
.dataTable td:last-child {
  font-weight: 800;
}
.historyGroup {
  margin-bottom: 18px;
}
.historyDate {
  font-weight: 800;
  margin: 0 0 8px;
}
.statsGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.statCard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.statLabel {
  font-size: 13px;
  color: var(--muted);
}
.statValue {
  font-size: 24px;
  font-weight: 820;
  margin-top: 4px;
}
.barRow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 3fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.barRow:hover {
  background: var(--soft);
}
.bar {
  height: 10px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.clientChevron {
  color: var(--muted);
  font-size: 18px;
}
.modalBack {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.38);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 14px;
}
.modalBack.open {
  display: flex;
}
.modal {
  width: min(650px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
}
.modal h2 {
  margin: 0 0 14px;
}
.field {
  margin: 12px 0;
}
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modalActions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 750;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: var(--soft);
}
.btn.delete {
  background: #fee2e2;
  color: var(--danger);
}
.previewBox {
  margin-top: 14px;
  background: var(--soft);
  border-radius: 16px;
  padding: 14px;
}
.previewEntry {
  padding: 12px 0;
  border-bottom: 1px solid #dbe1e8;
}
.previewEntry:last-child {
  border-bottom: 0;
}
.previewTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.previewClient {
  font-weight: 800;
}
.previewMeta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
}
.previewTopic {
  font-size: 14px;
  font-weight: 700;
  margin-top: 5px;
}
.previewDesc {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.actions button {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 750;
  cursor: pointer;
}
.actions .ok {
  background: var(--accent);
  color: #fff;
}
.actions .cancel {
  background: #fff;
  border: 1px solid var(--line);
}
.clarify {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff7ed;
  color: var(--warn);
  border: 1px solid #fed7aa;
}
.taskGroup {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.taskGroup:last-child {
  border-bottom: 0;
}
.taskHead {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.taskName {
  font-weight: 780;
}
.taskMeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.taskEntries {
  margin-top: 8px;
}
.taskEntry {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
}
.taskEntry .when {
  color: var(--muted);
}
.login {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.loginCard {
  width: min(420px, 100%);
}
.loginCard h1 {
  margin: 0 0 6px;
}
.loginCard p {
  color: var(--muted);
  margin: 0 0 16px;
}
.loginCard input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}
.loginCard button {
  width: 100%;
  margin-top: 10px;
}
.aiBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
}
.dot.off {
  background: #dc2626;
}
.source {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.previewItemActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.previewItemActions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}
.previewItemActions .saveOne {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.previewItemActions .refineVoice {
  background: #fff;
}
.previewItemActions .refineVoice.recording {
  background: #fee2e2;
  border-color: #fecaca;
  color: var(--danger);
}
.previewItemActions .refineVoice.working {
  opacity: 0.65;
  cursor: wait;
}
.previewItemActions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.previewEntry.incomplete {
  background: #fff7ed;
  margin: 0 -8px;
  padding: 12px 8px;
  border-radius: 12px;
}
.draftHint {
  font-size: 12px;
  color: var(--warn);
  margin-top: 6px;
}
.modal,
.modal * {
  min-width: 0;
}
.modal {
  max-width: calc(100vw - 28px);
  overflow-x: hidden;
}
.modal input,
.modal textarea {
  max-width: 100%;
}
.taskName,
.taskEntry > div,
.previewDesc,
.previewTopic,
.previewClient {
  overflow-wrap: anywhere;
  word-break: break-word;
}
html,
body {
  overflow-x: hidden;
}
.versionBadge {
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  background: var(--soft);
  padding: 4px 7px;
  border-radius: 999px;
  margin-left: 2px;
  line-height: 1;
  vertical-align: initial;
}
.periodTools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.exportBtn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 720;
  cursor: pointer;
}
.mobilePeriodCards {
  display: none;
}
.periodDayCard,
.periodClientCard {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 10px;
}
.periodCardHead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.periodCardTitle {
  font-weight: 800;
}
.periodCardMeta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.periodClientRow {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.periodClientRow:first-of-type {
  border-top: 0;
}
.periodClientTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 760;
}
.periodTask {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}
.periodTask strong {
  color: var(--text);
  font-weight: 700;
}
.desktopOnly {
  display: block;
}
@media (max-width: 680px) {
  .desktopOnly {
    display: none !important;
  }
  .mobilePeriodCards {
    display: block;
  }
  .periodTools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .exportBtn {
    width: 100%;
  }
  .app {
    padding-left: 12px;
    padding-right: 12px;
  }
  .entry {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 9px;
  }
  .dur {
    grid-column: 2;
  }
  .statsGrid {
    grid-template-columns: 1fr 1fr;
  }
  .nav {
    bottom: 8px;
    width: calc(100% - 16px);
  }
  .nav button {
    font-size: 11px;
    padding: 10px 2px;
  }
  .barRow {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .barRow .bar {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .top .date {
    display: none;
  }
  .capture {
    padding: 16px;
  }
  .capture h1 {
    font-size: 23px;
  }
  .micWrap {
    flex-direction: column;
    align-items: stretch;
  }
  .secondary {
    width: 100%;
  }
  .row2 {
    grid-template-columns: 1fr;
  }
  .modalBack {
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    padding: 16px;
    overscroll-behavior: contain;
  }
  .modalActions {
    align-items: stretch;
    flex-direction: column-reverse;
  }
  .modalActions > div {
    display: flex;
    gap: 8px;
  }
  .modalActions > div .btn {
    flex: 1;
  }
  .modalActions > .btn {
    width: 100%;
  }
  .taskEntry {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 7px;
  }
  .taskEntry strong {
    grid-column: 2;
  }
  .periodHead {
    align-items: flex-start;
  }
  .periodHead h1 {
    font-size: 20px;
  }
  .previewTop {
    align-items: flex-start;
  }
  .actions {
    flex-wrap: wrap;
  }
  .actions button {
    flex: 1 1 180px;
  }
}

/* FerkoTime v1.3: persistente Entwürfe */
.draftSaved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ok);
}
.draftSaved::before {
  content: "●";
  font-size: 9px;
}
