:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #555555;
  --color-border: #d4d4d4;
  --color-accent: #6c2bd9;
  --color-accent-hover: #581ab8;
  --color-error: #b00020;
  --radius: 6px;
  --space: 1rem;
  --max-width: 720px;
  --font-base: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space);
}

section { margin-bottom: 2rem; }

h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.hero {
  margin-top: 1rem;
}

.hero img {
  display: block;
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
}

.share .a2a_kit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.field { margin-bottom: 1rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

textarea, input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

textarea:focus, input[type="text"]:focus,
button:focus, a:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.hint {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0.25rem 0 0;
}

.counter {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0.25rem 0 0;
  text-align: right;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: var(--color-accent-hover); }

.status {
  margin-top: 0.75rem;
  min-height: 1.5em;
  font-size: 0.95rem;
}

.status.error { color: var(--color-error); }
.status.success { color: #1f7a1f; }

.comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comments-list li {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  background: #fafafa;
}

.comments-list li.empty {
  font-style: italic;
  color: var(--color-muted);
  background: transparent;
  border-style: dashed;
}

.comment .text {
  margin: 0 0 0.25rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment time {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Admin */

.admin-header {
  background: #f4f4f6;
  padding: 1rem var(--space);
  border-bottom: 1px solid var(--color-border);
}
.admin-header h1 { margin: 0 0 0.25rem; font-size: 1.25rem; }
.admin-header p { margin: 0; font-size: 0.9rem; }
.admin-header a { color: var(--color-accent); }

.admin-main {
  max-width: 960px;
}

.admin-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.admin-controls fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
}
.admin-controls fieldset legend {
  padding: 0 0.25rem;
  font-weight: 600;
  font-size: 0.875rem;
}
.admin-controls fieldset label {
  display: inline-block;
  font-weight: 400;
  margin-right: 0.75rem;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}
.admin-item.hidden { background: #fafafa; opacity: 0.85; }

.admin-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-visible { background: #e1f4e1; color: #1f7a1f; }
.badge-hidden { background: #f4e1e1; color: #8a2222; }

.admin-item .text {
  margin: 0 0 0.75rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-actions button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius);
  cursor: pointer;
}
.admin-actions button:hover { background: #f0f0f2; }

.btn-danger {
  border-color: var(--color-error) !important;
  color: var(--color-error) !important;
}
.btn-danger:hover { background: #fdecec !important; }

footer {
  border-top: 1px solid var(--color-border);
  padding: 1.5rem var(--space);
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

footer a { color: inherit; }

@media (min-width: 768px) {
  main { padding: 2rem; }
  h2 { font-size: 1.5rem; }
  .hero { margin-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
