:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #64717f;
  --line: #d7dee5;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --panel-strong: #eef3f6;
  --accent: #0f8b8d;
  --accent-dark: #075f66;
  --danger: #c2415a;
  --done: #2f8f58;
  --pin: #b7791f;
  --shadow: 0 16px 40px rgba(27, 39, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.11), transparent 34%),
    linear-gradient(315deg, rgba(183, 121, 31, 0.11), transparent 38%),
    var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  cursor: pointer;
}

.shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.login-view,
.app-view {
  min-height: calc(100vh - 46px);
}

.login-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.brand,
.topbar,
.summary-strip,
.todo-item {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 6px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  letter-spacing: 0;
}

.brand p,
.eyebrow,
small,
.feedback {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  font-size: 13px;
  color: var(--muted);
}

.password-row,
.add-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.16);
}

.password-row button,
.add-form button,
.summary-strip button {
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.password-row button {
  padding: 0 18px;
}

.add-form {
  margin: 16px 0 10px;
}

.add-form button {
  width: 46px;
  font-size: 25px;
  line-height: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 6px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.eyebrow {
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-button {
  width: 44px;
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 20px;
}

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

.feedback {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  font-size: 13px;
  line-height: 1.45;
}

.feedback.error {
  border-color: rgba(194, 65, 90, 0.35);
  color: var(--danger);
}

.summary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  padding: 12px;
  border-radius: 6px;
}

.summary-strip div {
  display: grid;
  gap: 1px;
}

.summary-strip span {
  font-size: 24px;
  font-weight: 800;
}

.summary-strip button {
  padding: 0 12px;
  background: var(--ink);
  font-size: 13px;
}

.todo-list {
  display: grid;
  gap: 10px;
  padding-bottom: 28px;
}

.section-title {
  margin: 12px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.todo-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
}

.todo-item.pinned {
  border-color: rgba(183, 121, 31, 0.42);
  background: #fffaf0;
}

.todo-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.35;
}

.todo-title.done {
  color: var(--muted);
  text-decoration: line-through;
}

.check-button,
.pin-button,
.delete-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
}

.check-button.done {
  background: var(--done);
  color: #fff;
}

.item-actions {
  display: flex;
  gap: 6px;
}

.pin-button.active {
  background: var(--pin);
  color: #fff;
}

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

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

[hidden] {
  display: none !important;
}

@media (max-width: 360px) {
  .shell {
    padding-inline: 10px;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-strip button {
    grid-column: 1 / -1;
  }
}
