* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #111111;
  --text-dim: #666666;
  --accent: #111111;
  --border: #111111;
  --shadow: 6px 6px 0 #111111;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.container {
  max-width: 520px;
  width: min(92vw, 520px);
  margin: 24px auto 80px;
  background: var(--panel);
  padding: 26px 26px 90px;
  border-radius: 0;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  animation: rise 200ms ease-out both;
}

h1 {
  margin: 0 0 18px;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-transform: none;
  font-weight: 600;
  color: var(--text);
}

.badge-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.name-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.info-btn {
  position: static;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.info-btn:hover {
  background: #111111;
  color: #ffffff;
}

.name-badge:hover {
  background: #111111;
  color: #ffffff;
}

.name-badge:hover .name-edit,
.name-badge:hover #nameText {
  color: inherit;
}

.name-edit {
  display: none;
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  width: 120px;
}

.name-badge.editing #nameText,
.name-badge.editing .name-label {
  display: none;
}

.name-badge.editing .name-edit {
  display: inline-block;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 6px;
  background: var(--text);
  animation: blink 1.6s step-end infinite;
  vertical-align: -2px;
}

@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.new-todo {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.name-row label {
  font-size: 12px;
  color: var(--text-dim);
}

.name-row input {
  flex: 0 1 220px;
  padding: 6px 8px;
  font-size: 12px;
}

.prompt-line {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

input {
  flex: 1;
  padding: 10px 10px;
  border-radius: 0;
  border: 2px solid var(--border);
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: background 120ms ease;
  font-size: 16px;
}

input::placeholder {
  color: #777777;
}

input:focus {
  background: #f5f5f5;
}

button {
  padding: 10px 14px;
  border-radius: 0;
  border: 2px solid var(--border);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
  font-size: 16px;
}

button:hover {
  background: #111111;
  color: #ffffff;
}

#todoList {
  padding: 0;
  margin: 0;
}

li {
  list-style: none;
  position: relative;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  border: 1px solid transparent;
  transition: background 120ms ease;
  font-size: 15px;
}

.swipe-bg {
  position: absolute;
  inset: 0;
  background: #ff3b30;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 0;
}

.item-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 6px;
  background: #ffffff;
  transition: transform 160ms ease;
}

li + li {
  margin-top: 6px;
}

li:hover {
  background: #f5f5f5;
}

li:hover .item-content {
  background: #f5f5f5;
}

li input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.meta {
  font-size: 11px;
  color: var(--text-dim);
  text-align: right;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-btn {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  padding: 4px 6px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
}

li:hover .delete-btn {
  opacity: 1;
  pointer-events: auto;
}

.done {
  text-decoration: line-through;
  opacity: 0.55;
}

.share {
  display: block;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
}

small {
  display: block;
  color: var(--text-dim);
  white-space: pre-line;
}

.share small {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.share-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.share-actions button {
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.share-actions button:hover {
  background: #111111;
  color: #ffffff;
}

.footer-actions {
  display: flex;
  gap: 8px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border-top: 2px solid var(--border);
  z-index: 10;
}

.footer-left {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.footer-left button {
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.footer-left button:hover {
  background: #111111;
  color: #ffffff;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-panel {
  position: relative;
  width: min(92vw, 520px);
  background: #ffffff;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
  padding: 16px 16px 18px;
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.modal-close {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #111111;
  color: #ffffff;
}

.modal-body {
  font-size: 13px;
  color: var(--text);
}

.modal-list {
  margin: 0 0 12px;
  padding-left: 16px;
}

.modal-list li {
  list-style: disc;
  border: none;
  background: transparent;
  padding: 2px 0;
  font-size: 13px;
}

.modal-note {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 12px;
}

.modal-contact {
  margin: 10px 0 0;
  font-size: 12px;
}

.modal-future {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.mono {
  font-family: inherit;
}

@media (max-width: 560px) {
  body {
    background: #ffffff;
  }

  .container {
    width: 100%;
    margin: 0;
    padding: 18px 16px 120px;
    border: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 14px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-bottom: 14px;
  }

  input {
    padding: 14px 12px;
    font-size: 16px;
  }

  .new-todo {
    flex-direction: column;
    gap: 10px;
  }

  #addBtn {
    width: 100%;
    padding: 12px 12px;
    font-size: 16px;
  }

  li {
    padding: 10px 6px;
    font-size: 16px;
  }

  .item-content {
    grid-template-columns: 26px 1fr;
  }

  .meta {
    display: none;
  }

  .delete-btn {
    display: none;
  }

  .swipe-bg {
    display: none;
  }

  .share {
    margin-top: 20px;
    padding: 14px;
    border: 2px solid var(--border);
  }

  .share-actions {
    gap: 8px;
    flex-direction: column;
  }

  .footer-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    gap: 8px;
    justify-content: space-between;
    padding: 12px 14px;
    background: #ffffff;
    border-top: 2px solid var(--border);
  }

  .footer-left {
    flex: 1 1 0;
  }

  .footer-left button {
    flex: 1 1 0;
    font-size: 14px;
    padding: 12px 10px;
  }

  .name-badge {
    position: static;
    margin: 0;
    width: fit-content;
    font-size: 12px;
  }

  .badge-row {
    width: fit-content;
  }

  .name-badge {
    padding: 4px 6px;
  }

  .name-badge .name-label {
    display: none;
  }

  #nameText {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .info-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .modal-panel {
    width: min(92vw, 520px);
  }
}
