* {
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
}
body {
  background: #f4f6f8;
  color: #333;
  display: flex;
  justify-content: center;
  padding: 20px;
}
.container {
  width: 100%;
  max-width: 640px;
}
/* "form { display: flex }" would otherwise override the hidden attribute */
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
h1 {
  margin-bottom: 16px;
  font-size: 1.6rem;
}
.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
input,
textarea,
button {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}
button {
  cursor: pointer;
  background: #0066cc;
  color: #fff;
  border: none;
  font-weight: bold;
}
button:hover:not(:disabled) {
  background: #0052a3;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.post-header {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}
.post-title {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.post-content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-top: 8px;
  display: block;
}
.vote-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.vote-actions button {
  background: #e5e5e5;
  color: #222;
  border: 1px solid #bbb;
  padding: 4px 10px;
}
.vote-actions button:hover:not(:disabled) {
  background: #d8d8d8;
}
.vote-actions button[aria-pressed="true"] {
  background: #0066cc;
  border-color: #0052a3;
  color: #fff;
}
.vote-actions button[aria-pressed="true"]:hover:not(:disabled) {
  background: #0052a3;
}
.vote-actions .btn-privacy {
  margin-left: auto;
}
.card-private {
  border-style: dashed;
  background: #fafafa;
}
.badge-private {
  background: #555;
  color: #fff;
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 4px;
  font-size: 0.75rem;
  font-weight: bold;
}

.panel-title {
  font-size: 1.1rem;
  margin-bottom: 4px;
}
label {
  font-size: 0.9rem;
}
.hint {
  font-size: 0.85rem;
  color: #666;
}
.button-row,
.account-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-row {
  justify-content: space-between;
}
.button-row button {
  flex: 1;
}
.btn-secondary {
  background: #e5e5e5;
  color: #222;
  border: 1px solid #bbb;
}
button.btn-secondary:hover:not(:disabled) {
  background: #d8d8d8;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: #0066cc;
  font-size: 0.9rem;
}
#password-form {
  margin-top: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: white;
  padding: 20px;
  border-radius: 6px;
  width: 90%;
  max-width: 380px;
  text-align: center;
}
.modal-content h3 {
  color: #d32f2f;
  margin-bottom: 8px;
}
.modal-content button {
  margin-top: 12px;
  width: 100%;
}
