:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: rgba(17, 17, 17, 0.55);
  --card: #ffffff;
  --stroke: rgba(17, 17, 17, 0.14);
  --accent: #111111;
  --danger: #b00020;
}

* { box-sizing: border-box; }
/* Ensure HTML `hidden` works even if author styles set display on the same elements. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.hero {
  padding: 14px 4px 10px;
}

.topline {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

h1 {
  margin: 10px 0 0;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  letter-spacing: -0.03em;
  font-weight: 900;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--fg);
  transform-origin: center;
  box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.22);
  animation: pulse 1.15s ease-in-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.65); opacity: 0.55; box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.22); }
  50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 10px rgba(17, 17, 17, 0.07); }
  100% { transform: scale(0.65); opacity: 0.55; box-shadow: 0 0 0 0 rgba(17, 17, 17, 0.0); }
}

.card {
  margin-top: 16px;
  border: 1px solid var(--stroke);
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
}

.form .row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .form .row { grid-template-columns: 1fr; }
}

.field { display: block; }

.label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

input[type="text"] {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  padding: 0 12px;
  color: var(--fg);
  outline: none;
}

input[type="text"]:focus {
  border-color: rgba(17, 17, 17, 0.55);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  background: #111111;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
  padding: 0 14px;
}

button.ghost {
  border-color: var(--stroke);
  background: #ffffff;
  color: var(--fg);
}

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

.status {
  margin: 10px 0 0;
  min-height: 1.2em;
  color: var(--muted);
  font-weight: 700;
}

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

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

.list-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

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

.list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.del {
  margin-left: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--danger);
  text-decoration: underline;
  font-weight: 900;
  cursor: pointer;
}

.del:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.msg {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.4;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.foot {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0 4px;
}

.foot-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

button.link {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-decoration: underline;
  font-weight: 800;
  cursor: pointer;
}

.admin {
  margin-top: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  color: var(--fg);
}

.admin-form {
  display: grid;
  gap: 10px;
}

input[type="password"] {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  padding: 0 12px;
  color: var(--fg);
  outline: none;
}

input[type="password"]:focus {
  border-color: rgba(17, 17, 17, 0.55);
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}
