:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c1e21;
  --muted: #6b7280;
  --accent: #0ea5e9;
  --success: #16a34a;
  --danger: #dc2626;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, #e0f2fe 0%, transparent 33%),
    radial-gradient(circle at 100% 100%, #dcfce7 0%, transparent 30%),
    var(--bg);
  line-height: 1.45;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
}

.card {
  width: 100%;
  max-width: 900px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  border: 1px solid #e5e7eb;
}

.topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.4rem, 5vw, 2rem);
}

.muted {
  margin: 0;
  color: var(--muted);
}

.user-info {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.btn-accent {
  border-color: #0284c7;
  background: var(--accent);
  color: #fff;
}

.btn-success {
  border-color: #15803d;
  background: var(--success);
  color: #fff;
}

.btn-danger {
  border-color: #b91c1c;
  background: var(--danger);
  color: #fff;
}

.plan-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
  min-height: 220px;
}

.plan-day {
  margin: 1rem 0 0.4rem;
  color: #0f172a;
  font-size: 1.1rem;
}

.plan-day:first-child {
  margin-top: 0;
}

.plan-line {
  margin: 0.2rem 0;
}

.plan-spacer {
  height: 0.55rem;
}

.meta {
  margin-top: 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.editor-form,
.auth-form {
  display: grid;
  gap: 0.7rem;
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.75rem;
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 320px;
}

.alert {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 10px;
  padding: 0.7rem;
  margin-bottom: 1rem;
}

.history-list {
  display: grid;
  gap: 0.55rem;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  padding: 0.75rem;
}

.history-item:hover {
  background: #f0f9ff;
}

.auth-page {
  align-items: center;
}

.auth-card {
  max-width: 460px;
}

.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: none;
}

@media (min-width: 768px) {
  .card {
    padding: 1.5rem;
  }

  .actions {
    margin: 1.1rem 0 1.2rem;
  }
}
