:root {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Segoe UI",
    sans-serif;

  color: #17202a;
  background: #f6f7fb;

  --card: #ffffff;
  --line: #e4e7ec;
  --muted: #667085;
  --primary: #1f2937;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7fb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 5px 22px rgba(16, 24, 40, 0.05);
}

/* Login */

.login-card {
  max-width: 430px;
  margin: 10vh auto;
  padding: 28px;
  text-align: center;
}

.brand {
  font-size: 42px;
}

.login-card h1 {
  margin-bottom: 6px;
}

/* General */

.muted {
  color: var(--muted);
}

.error {
  color: var(--danger);
  min-height: 20px;
}

/* Top bar */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px 18px;
}

.topbar h1 {
  margin: 3px 0 0;
  font-size: 28px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

/* Buttons */

.primary {
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
}

.primary:active {
  transform: scale(0.98);
}

.ghost {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 11px 14px;
}

.icon-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 20px;
}

/* Form */

label {
  display: block;
  text-align: left;
  font-weight: 650;
  margin: 14px 0;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 11px;
  background: white;
}

textarea {
  resize: vertical;
}

/* Quick logging */

.quick-card {
  padding: 12px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.quick-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 12px 5px;
  min-height: 74px;

  font-weight: 650;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  gap: 5px;

  -webkit-tap-highlight-color: transparent;
}

.quick-btn span {
  font-size: 24px;
  line-height: 1;
}

.quick-btn:active {
  transform: scale(0.97);
  background: #f2f4f7;
}

/* Day navigation */

.day-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 8px;
  margin: 14px 0;
}

.nav-btn,
.date-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  min-height: 44px;
}

.date-button {
  font-weight: 700;
}

/* Daily summary */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 8px;
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 19px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

/* Timeline */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head h2 {
  font-size: 20px;
  margin: 0 0 10px;
}

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

.event-row {
  display: grid;

  grid-template-columns:
    60px
    38px
    1fr
    auto;

  align-items: center;

  gap: 9px;

  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;

  padding: 11px 10px;
}

.event-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.event-icon {
  font-size: 22px;
  text-align: center;
}

.event-name {
  font-weight: 650;
}

.event-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.event-by {
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.edit-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px;
  font-size: 18px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 10px;
}

/* Dialog */

dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;

  width: min(520px, calc(100% - 28px));

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.38);
}

#event-form {
  padding: 20px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-head h2 {
  margin: 0;
}

.dialog-actions {
  display: grid;

  grid-template-columns:
    auto
    1fr
    auto
    auto;

  gap: 8px;

  align-items: center;

  margin-top: 18px;
}

.danger {
  color: var(--danger);
}

/* Toast */

.toast {
  position: fixed;

  left: 50%;
  bottom: 20px;

  transform: translateX(-50%);

  background: #17202a;
  color: white;

  padding: 10px 14px;

  border-radius: 999px;

  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.18);

  z-index: 100;
}

/* Larger screens */

@media (min-width: 600px) {

  .quick-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .summary-grid {
    grid-template-columns: repeat(6, 1fr);
  }

}

/* Small iPhones */

@media (max-width: 380px) {

  .event-row {
    grid-template-columns:
      50px
      34px
      1fr
      auto;

    gap: 6px;
  }

}