:root {
  --bg: #f4f6fb;
  --ink: #18222f;
  --muted: #566273;
  --card: #ffffff;
  --line: #c8d1de;
  --accent: #1f6feb;
  --accent-strong: #1558bc;
  --warn: #b42318;
  --ok: #157f3b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #dce8ff, transparent 40%),
    radial-gradient(circle at 80% 90%, #eaf8ec, transparent 45%),
    var(--bg);
  font-family: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", sans-serif;
  min-height: 100vh;
}

.app-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(31, 48, 77, 0.08);
}

.hidden {
  display: none;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

h1 {
  margin-bottom: 10px;
}

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

label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 11px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 8px 13px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  background: #8a96a8;
  cursor: not-allowed;
}

button.danger {
  background: #c73f3f;
}

button.danger:hover {
  background: #a93333;
}

.unlock-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.unlock-footer .status {
  margin: 0;
  flex: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.notes-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fbfcff;
}

.note-card.editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.12);
}

.note-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.note-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.note-actions {
  display: flex;
  gap: 8px;
}

.note-actions button {
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.2;
}

.note-editor {
  min-height: 120px;
  max-height: 320px;
  resize: none;
  line-height: 1.45;
  background: #fff;
  overflow-y: auto;
}

.note-editor:disabled {
  background: #f6f8fc;
  color: #4a5567;
}

.muted {
  color: var(--muted);
  margin: 0 0 14px;
}

.status {
  min-height: 1.25em;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: var(--warn);
}

.status.success {
  color: var(--ok);
}

@media (max-width: 700px) {
  .app-shell {
    padding: 12px;
  }

  .card {
    padding: 12px;
  }

  .topbar,
  .note-card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .unlock-footer {
    align-items: stretch;
  }

  .top-actions,
  .note-actions {
    width: 100%;
  }

  .top-actions button,
  .note-actions button {
    flex: 1;
  }
}
