body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #f6f4ee;
}

header {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  font-size: 20px;
  font-weight: bold;
  color: #222;
  text-decoration: none;
}

nav a {
  color: #555;
  text-decoration: none;
  padding: 4px 8px;
}

nav a:hover {
  background: #eee;
}

nav a.active {
  background: #2c6e49;
  color: #fff;
}

.page {
  max-width: 950px;
  margin: 0 auto;
  padding: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

h1 {
  font-size: 28px;
  margin: 0 0 4px;
}

h2 {
  font-size: 19px;
  margin: 0 0 6px;
}

h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

p {
  margin: 6px 0;
}

.page-head {
  margin-bottom: 16px;
}

.page-head p,
.date-line,
.muted {
  color: #666;
}

button {
  font-family: inherit;
  font-size: 15px;
  padding: 7px 14px;
  border: 1px solid #2c6e49;
  background: #2c6e49;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #245a3b;
}

.plain {
  background: #fff;
  color: #222;
  border: 1px solid #999;
}

.plain:hover {
  background: #eee;
}

button.active {
  background: #2c6e49;
  border-color: #2c6e49;
  color: #fff;
}

.link {
  background: none;
  border: none;
  color: #555;
  font-size: 14px;
  text-decoration: underline;
  padding: 2px 4px;
}

.link:hover {
  background: none;
  color: #000;
}

.del {
  color: #b3261e;
}

form {
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.form-row > div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 130px;
}

.form-row > div.wide {
  flex: 2;
}

label {
  font-size: 14px;
  margin-bottom: 2px;
}

input,
select {
  font-family: inherit;
  font-size: 15px;
  padding: 6px;
  border: 1px solid #bbb;
  background: #fff;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
}

input[type="color"] {
  width: 50px;
  height: 33px;
  padding: 1px;
}

.hidden {
  display: none;
}

.edit-hint {
  margin-top: 8px;
  font-size: 14px;
  color: #666;
}

.filters {
  margin-bottom: 10px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #e2e2e2;
}

.grow {
  flex: 1;
  min-width: 0;
}

.title {
  font-weight: bold;
}

.meta,
.exam-notes {
  font-size: 13px;
  color: #666;
}

.exam-notes {
  margin-top: 2px;
}

.overdue {
  color: #b3261e;
  font-weight: bold;
}

.row.done .title {
  color: #888;
  text-decoration: line-through;
}

.actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.empty {
  color: #777;
  padding: 10px 0;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
}

.box {
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  color: #555;
  border: 1px solid #ccc;
  padding: 1px 6px;
  margin-left: 6px;
}

.countdown {
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid #ccc;
  padding: 2px 6px;
}

.countdown.soon {
  border-color: #2c6e49;
  color: #2c6e49;
}

.countdown.past {
  border-color: #b3261e;
  color: #b3261e;
}

.exam-when {
  color: #2c6e49;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 8px 16px;
}

.greeting {
  margin-bottom: 16px;
}

.home-grid {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.home-content {
  flex: 2;
}

.home-sidebar {
  flex: 1;
}

.section {
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.focus-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.timer-box {
  flex: 1;
  text-align: center;
}

.focus-sidebar {
  flex: 1;
}

.presets {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.timer-clock {
  font-size: 52px;
  margin: 8px 0;
}

.timer-progress {
  height: 12px;
  background: #fff;
  border: 1px solid #999;
  margin: 12px 0;
}

.timer-progress .fill {
  height: 100%;
  background: #2c6e49;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.stats-row {
  display: flex;
  gap: 20px;
}

.stat-num {
  display: block;
  font-size: 22px;
  font-weight: bold;
}

.stat-label {
  font-size: 13px;
  color: #666;
}

.planner-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.cal {
  flex: 1;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dow {
  text-align: center;
  font-size: 12px;
  color: #666;
  padding: 3px 0;
}

.cal-day {
  min-height: 50px;
  background: #eee;
  border: 1px solid #eee;
  padding: 3px;
  font-size: 14px;
  cursor: pointer;
}

.cal-day:hover {
  border-color: #999;
}

.cal-day.other {
  visibility: hidden;
}

.cal-day.today {
  border-color: #2c6e49;
}

.cal-day.selected {
  background: #fff;
  border-color: #222;
}

.cal-day .num {
  font-weight: bold;
}

.cal-day .dots {
  margin-top: 3px;
}

.cal-day .dots i {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #2c6e49;
  margin-right: 2px;
}

.day-detail {
  width: 280px;
}

.subject-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.subject {
  width: 220px;
  background: #fff;
  border: 1px solid #ddd;
  padding: 12px;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
}

@media (max-width: 800px) {
  .home-grid,
  .focus-layout,
  .planner-content {
    flex-direction: column;
  }

  .day-detail {
    width: auto;
  }
}

@media (max-width: 600px) {
  .row {
    flex-wrap: wrap;
  }

  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .subject {
    width: 100%;
  }

  .timer-clock {
    font-size: 40px;
  }
}
