:root {
  --line: 26px;
  --lines-per-section: 6;
  --ink: #222;
  --faint: #e6e6e6;
}

/* Base page styling */
body {
  font-family: "Inter", Arial, sans-serif;
  margin: 20px;
  background: #f5f5f5;
  color: var(--ink);
}

.controls {
  margin-bottom: 20px;
}

button {
  padding: 8px 12px;
  margin-right: 6px;
  border: none;
  background: #eee;
  cursor: pointer;
}

/* Printable page container */
.page {
  background: var(--page-bg, white);
  padding: 40px;
  min-height: 700px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

/* Repeating ruled-line system */
.lined-area {
  line-height: var(--line);
  min-height: calc(var(--line) * var(--lines-per-section, 6));
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(var(--line) - 1px),
    var(--faint) var(--line)
  );
  background-size: 100% var(--line);
  padding: 4px 2px;
}

.no-lines {
  background-image: none !important;
}

/* Weekly grid */
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 20px;
}

.day {
  min-height: 220px;
}

.day-title {
  font-weight: bold;
  border-bottom: 1px solid var(--faint);
  margin-bottom: 4px;
}

.divider {
  height: 1px;
  background: var(--faint);
  margin: 12px 0;
}

select,
input[type="color"] {
  padding: 6px;
  margin-right: 6px;
  border: none;
  background: #eee;
}

h3 {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #555;
}

/* Print rules */
@media print {
  body {
    background: white;
  }

  .controls {
    display: none;
  }

  .page {
    width: 297mm;
    min-height: 200mm;
    padding: 10mm;
    box-shadow: none;
    margin: 0;
  }

  @page {
    size: A4 landscape;
    margin: 0;
  }
}