:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #18212f;
  --muted: #687386;
  --line: #d9dee8;
  --alias-magenta: #f000b8;
  --alias-magenta-strong: #c60098;
  --alias-magenta-soft: #fff0fb;
  --accent: var(--alias-magenta);
  --accent-strong: var(--alias-magenta-strong);
  --danger: #b42318;
  --warning: #735c00;
  --focus: #2f80ed;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 14px;
  cursor: pointer;
}

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

button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--text);
}

button.secondary:hover {
  border-color: var(--accent);
  background: var(--alias-magenta-soft);
}

button.danger {
  border-color: var(--danger);
  background: white;
  color: var(--danger);
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 11px 12px;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

h1,
h2,
p {
  margin: 0;
}

.shell {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-form {
  width: min(380px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}

.login-form h1,
.topbar h1 {
  font-size: 22px;
  line-height: 1.2;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar p,
.items-head span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 14px;
}

.top-actions,
.composer-actions,
.item-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  margin-bottom: 18px;
}

.text-form,
.file-form {
  display: grid;
  gap: 8px;
}

.composer-actions {
  align-items: stretch;
}

.composer-actions input {
  flex: 1;
}

.file-form {
  margin-top: 12px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

progress {
  width: 100%;
  margin-top: 10px;
}

.status-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

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

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

.items {
  display: grid;
  gap: 10px;
}

.items-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.items-head h2 {
  font-size: 18px;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-body {
  color: var(--muted);
  margin-top: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.item-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.item-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  text-align: center;
}

.kept {
  color: var(--accent);
  font-weight: 650;
}

@media (max-width: 680px) {
  .shell {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .composer-actions,
  .file-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .composer-actions input {
    grid-column: 1 / -1;
  }

  .top-actions button,
  .file-row button,
  .composer-actions button {
    width: 100%;
  }
}
