:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #ffffff;
  --muted: #8e8e93;
  --line: #e5e5ea;
  --dock-bottom: env(safe-area-inset-bottom);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

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

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.screen[hidden] {
  display: none;
}

#capture,
#login-form {
  padding-bottom: calc(52px + var(--dock-bottom) + 12px);
}

#login-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  margin: 0;
  padding-top: env(safe-area-inset-top);
  overflow: auto;
}

.login-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 32px 28px;
}

.login-brand img {
  width: min(300px, 76vw);
  height: auto;
  display: block;
}

.login-brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

@media (max-height: 700px) {
  .login-brand {
    gap: 10px;
    padding: 0 40px 18px;
  }

  .login-brand img {
    width: min(210px, 58vw);
  }

  .login-brand h1 {
    font-size: 20px;
  }
}

.top {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.top.end {
  justify-content: flex-end;
}

.top h1 {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
}

.icon-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  flex: none;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.offline {
  margin: 0 0 0 4px;
  font-size: 13px;
  color: var(--muted);
}

#draft {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 8px 20px 12px;
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  font-size: 22px;
  line-height: 1.35;
  -webkit-appearance: none;
  appearance: none;
}

#draft::placeholder {
  color: var(--muted);
}

.dock {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: var(--dock-bottom);
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #ffffff;
  font-size: 17px;
  z-index: 5;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 20px;
}

.login-fields input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 17px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.login-error {
  min-height: 18px;
  margin: 16px 20px 0;
  font-size: 13px;
  color: #ff2d3a;
}

.menu-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.menu-list button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 64px;
  padding: 0 20px;
  border: 0;
  background: var(--paper);
  font-size: 22px;
  font-weight: 400;
  text-align: left;
}

.menu-list button.is-current {
  font-weight: 700;
}

#logout {
  margin-top: auto;
  color: var(--muted);
}

#notes {
  flex: 1;
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-overflow-scrolling: touch;
}

.note {
  padding: 16px 20px 4px;
  border-bottom: 1px solid var(--line);
}

.note p {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note p.done {
  text-decoration: line-through;
}

.note time {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.choices {
  display: flex;
  gap: 12px;
}

.choice {
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 400;
}

.choice input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #111111;
}

.choice:has(input:checked) {
  font-weight: 700;
}

.empty {
  margin: 0;
  padding: 24px 20px;
  font-size: 17px;
  color: var(--muted);
}
