:root {
  --bg: #f7f7f2;
  --panel: #ffffff;
  --text: #172118;
  --muted: #677064;
  --line: #dde5d7;
  --accent: #14532d;
  --accent-soft: #dcfce7;
  --danger: #9f1239;
  --danger-soft: #ffe4e6;
  --shadow: 0 16px 40px rgba(23, 33, 24, 0.08);
}

* { box-sizing: border-box; }

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(247, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

h1, h2, p { margin-top: 0; }

h1 { margin-bottom: 0; font-size: clamp(1.6rem, 6vw, 2.4rem); }
h2 { margin-bottom: 0.55rem; }

.eyebrow {
  margin-bottom: 0.2rem;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.hero p, .toolbar p, .menu-meta, .status {
  color: var(--muted);
}

label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  font-weight: 700;
}

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

textarea {
  resize: vertical;
  min-height: 160px;
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.actions.compact { margin-top: 0.4rem; }

button, .fileBtn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1rem;
  font-weight: 800;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: white;
  min-height: 44px;
}

button.secondary, .fileBtn {
  color: var(--accent);
  background: var(--accent-soft);
}

button.ghost {
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
}

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

button:active, .fileBtn:active { transform: translateY(1px); }

.fileBtn input { display: none; }

.hidden { display: none !important; }

.toolbar {
  margin: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.menus {
  display: grid;
  gap: 1rem;
}

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

.badge {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 800;
  font-size: 0.82rem;
}

.badge.draft {
  background: #fef3c7;
  color: #92400e;
}

.week-table-wrap {
  overflow: auto;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.week-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.week-table th, .week-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}

.week-table th {
  background: #f1f5ed;
  color: #243326;
}

.week-table tr:last-child td { border-bottom: 0; }

.day-cards {
  display: none;
  margin-top: 1rem;
  gap: 0.8rem;
}

.day-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem;
  background: #fffefb;
}

.day-card h3 { margin: 0 0 0.65rem; }

.day-card dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.day-card dt {
  font-weight: 800;
  color: var(--accent);
}

.day-card dd {
  margin: 0;
  color: var(--text);
}

.today {
  outline: 3px solid var(--accent-soft);
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 760px) {
  .toolbar, .menu-top {
    flex-direction: column;
  }
  .week-table-wrap { display: none; }
  .day-cards { display: grid; }
  .actions button, .fileBtn { flex: 1 1 auto; text-align: center; }
  .app-header { align-items: flex-start; }
}
