:root { color-scheme: light; }
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f5f6f8;
  color: #1a1d23;
}

header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  position: sticky;
  top: 0;
}
header h1 { font-size: 18px; margin: 0; }
#status {
  flex: 1;
  font-size: 13px;
  color: #5b6472;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#status.error { color: #b42318; }
.header-actions { display: flex; gap: 8px; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.composer { display: flex; gap: 8px; margin-bottom: 16px; }
.composer textarea {
  flex: 1;
  resize: vertical;
  min-height: 56px;
  border: 1px solid #d4d9e0;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

button {
  border: 1px solid #c9d2dd;
  background: #fff;
  color: #1a1d23;
  border-radius: 8px;
  padding: 6px 12px;
  font: inherit;
  cursor: pointer;
}
button:hover { background: #eef2f7; }

ul#notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.note {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note-text { white-space: pre-wrap; word-break: break-word; }
.note textarea {
  width: 100%;
  font: inherit;
  border: 1px solid #d4d9e0;
  border-radius: 8px;
  padding: 8px;
}
.note-actions { display: flex; gap: 8px; align-items: center; }
.pending { font-size: 12px; color: #b45309; margin-right: auto; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 25, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}
.modal-card h2 { margin-top: 0; }
.modal-card section { margin-bottom: 20px; }
.modal-card input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  margin: 8px 0;
  border: 1px solid #d4d9e0;
  border-radius: 8px;
  font: inherit;
}
.close { position: absolute; top: 12px; right: 12px; }

#key-box, #link-panel { margin-top: 12px; text-align: center; }
#key-box canvas, #link-panel canvas {
  display: block;
  margin: 0 auto 8px;
  max-width: 100%;
  height: auto;
}
#key-value, #link-key {
  display: block;
  font-size: 12px;
  word-break: break-all;
  background: #f1f3f6;
  border-radius: 8px;
  padding: 8px;
  margin: 8px 0;
}

.hidden { display: none !important; }
