:root {
  --bg: #EDEAE2;
  --surface: #F8F6F0;
  --ink: #22282B;
  --ink-soft: #5B6367;
  --ink-faint: #8B9194;
  --line: #D8D3C6;
  --line-strong: #C3BDAC;
  --petrol: #1E4F52;
  --petrol-soft: #3D7276;
  --petrol-bg: #DEEAE9;
  --amber: #9C7530;
  --amber-bg: #F3E6CD;
  --red: #A3453D;
  --red-bg: #F2DEDB;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'IBM Plex Sans', -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 28px;
}

.header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1.1rem;
}

.header h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.header time {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: right;
}

.pomodoro-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
}

.timer {
  min-width: 64px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.pomodoro-bar button,
.capture-box button,
.footer-note button {
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  color: var(--petrol);
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.pomodoro-bar button:hover,
.capture-box button:hover,
.footer-note button:hover {
  border-color: var(--petrol-soft);
  color: var(--petrol-soft);
}

.capture-box button:not(:disabled) {
  background: var(--petrol);
  border-color: var(--petrol);
  color: var(--surface);
}

.capture-box button:not(:disabled):hover {
  background: var(--petrol-soft);
  color: var(--surface);
}

.pomodoro-bar span,
.capture-hint,
.footer-note {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.capture-box {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.capture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.capture-row select,
.capture-row input,
.inline-date {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.capture-row select,
.capture-row input {
  padding: 4px 8px;
}

.capture-row input[aria-label='Beschreibung'] {
  flex: 1 1 220px;
}

.capture-row input::placeholder {
  color: var(--ink-faint);
}

.capture-row select:focus,
.capture-row input:focus,
.inline-date:focus {
  border-color: var(--petrol-soft);
}

.capture-hint {
  margin: 0.65rem 0 0;
}

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  margin-bottom: 0.5rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-strong);
}

.tabs button {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tabs button.active {
  background: var(--petrol);
  color: var(--surface);
}

.tabs span {
  font-family: var(--mono);
}

.entry-list {
  margin-top: 0.1rem;
}

.empty-note {
  margin: 0;
  padding: 10px 4px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}

.row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.row:last-child,
.week-group:last-child .row:last-child {
  border-bottom: 0;
}

.flag-button {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 2px;
  line-height: 0;
}

.flag-button svg {
  display: block;
}

.row-main {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-text {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.is-resolved .entry-text {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 3px;
}

.type-badge,
.meta-badge,
.waiting-days,
.inline-date,
.week-group h2 {
  font-family: var(--mono);
}

.type-badge,
.meta-badge {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.5;
}

.type-badge.aufgabe {
  background: var(--petrol-bg);
  color: var(--petrol);
}

.type-badge.warte_auf {
  background: var(--amber-bg);
  color: var(--amber);
}

.type-badge.entscheidung {
  background: var(--line);
  color: var(--ink-soft);
}

.meta-badge {
  color: var(--ink-soft);
}

.waiting-days {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
}

.waiting-days.amber {
  color: var(--amber);
}

.waiting-days.red {
  color: var(--red);
}

.contact-link {
  padding: 0;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.contact-link:hover {
  color: var(--petrol);
}

.inline-date {
  min-height: 22px;
  padding: 1px 5px;
  color: var(--ink-soft);
  font-size: 11px;
}

.delete-button {
  flex: 0 0 auto;
  padding: 0 2px;
  color: var(--ink-faint);
  font-size: 14px;
  line-height: 1;
}

.delete-button:hover {
  color: var(--red);
}

.week-group h2 {
  margin: 1rem 0 0;
  padding: 8px 4px 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
  .app-shell {
    width: calc(100% - 48px);
    padding-top: 24px;
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .header time {
    text-align: left;
  }

  .capture-row {
    flex-direction: column;
    align-items: stretch;
  }

  .capture-row select,
  .capture-row input,
  .capture-row button {
    width: 100%;
  }

  .capture-row input[aria-label='Beschreibung'] {
    flex-basis: auto;
  }

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

  .footer-note {
    flex-direction: column;
    align-items: flex-start;
  }
}
