.home-content {
  width: min(820px, calc(100% - 34px));
  margin: 0 auto;
  padding: 18px 0 50px;
  color: #111111;
}

.home-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid #8da6b4;
  background: linear-gradient(#f7fcff, #c3dfec);
  color: #1d3551;
}

.home-section-bar h2 {
  margin: 0;
  font-size: 13px;
}

.mini-button,
.add-block-control select {
  min-height: 25px;
  border: 1px solid #707070;
  border-radius: 2px;
  background: linear-gradient(#ffffff, #d9d9d9);
  color: #111111;
  font: 11px Arial, Helvetica, sans-serif;
}

.mini-button {
  padding: 3px 9px;
  cursor: pointer;
}

.add-block-control {
  display: flex;
  gap: 5px;
}

.alert-center,
.dashboard-section,
.tools-section {
  margin-bottom: 20px;
}

#home-alerts {
  display: grid;
  gap: 5px;
  padding-top: 6px;
}

.home-alert {
  --urgency-hue: 40;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid hsl(var(--urgency-hue) 65% 38%);
  border-left-width: 7px;
  background: hsl(var(--urgency-hue) 80% 95%);
}

.home-alert strong {
  font-size: 13px;
}

.home-alert span {
  grid-column: 1;
  font: bold 11px "Courier New", monospace;
}

.home-alert a {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: #0000ee;
  font-size: 11px;
}

.home-alert.overdue {
  --urgency-hue: 0;
  animation: home-alert-flash 1s steps(2, end) infinite;
}

.all-clear {
  margin: 0;
  padding: 16px;
  border: 1px solid #79a779;
  border-top: 0;
  background: #effbef;
  color: #205f20;
  font-size: 12px;
  text-align: center;
}

.notification-note {
  margin: 6px 0 0;
  color: #666666;
  font-size: 10px;
  text-align: right;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 9px;
}

.dashboard-card {
  position: relative;
  min-height: 150px;
  padding: 15px;
  border: 1px solid #a5a5a5;
  background: #f7f7f7;
  box-shadow: inset 0 1px 0 #ffffff;
}

.dashboard-card h3 {
  margin: 0 90px 12px 0;
  color: #1d3551;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.block-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 3px;
}

.block-controls button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #999999;
  background: #eeeeee;
  cursor: pointer;
}

.block-main {
  display: block;
  color: #1d3551;
  font: bold clamp(22px, 5vw, 34px) "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.block-detail {
  display: block;
  margin-top: 7px;
  color: #555555;
  font-size: 11px;
  line-height: 1.4;
}

.wake-options {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.wake-options button {
  min-height: 38px;
  padding: 5px 11px;
  border: 1px solid #777777;
  background: linear-gradient(#ffffff, #dddddd);
  font-weight: bold;
}

.wake-options button.selected {
  background: #c3dfec;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 25%);
}

.fact-text {
  margin: 0 0 13px;
  color: #24344d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.45;
}

.fact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fact-key-form {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #aaaaaa;
  background: #eeeeee;
}

.fact-key-form label,
.fact-key-form small {
  display: block;
  font-size: 10px;
}

.fact-key-form > div {
  display: flex;
  gap: 5px;
  margin: 5px 0;
}

.fact-key-form input {
  min-width: 0;
  flex: 1;
  border: 1px solid #777777;
}

.fact-credit {
  display: inline-block;
  margin-top: 10px;
  color: #555555;
  font-size: 9px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 9px;
}

.tool-grid a {
  display: flex;
  min-height: 105px;
  flex-direction: column;
  justify-content: center;
  padding: 18px;
  border: 1px solid #8da6b4;
  background: linear-gradient(145deg, #f9fdff, #d6eaf3);
  color: #1d3551;
  text-decoration: none;
  box-shadow: inset 0 1px 0 #ffffff, 0 1px 2px rgb(0 0 0 / 12%);
}

.tool-grid a:active {
  background: #bfdce9;
  box-shadow: inset 0 2px 4px rgb(0 0 0 / 22%);
}

.tool-grid strong {
  font-size: clamp(18px, 4vw, 25px);
}

.tool-grid span {
  margin-top: 5px;
  color: #4d5e6b;
  font-size: 11px;
}

@keyframes home-alert-flash {
  50% { background: #ffb9b9; }
}

@media (prefers-reduced-motion: reduce) {
  .home-alert.overdue { animation: none; background: #ffd1d1; }
}

@media (max-width: 600px) {
  .home-content {
    width: calc(100% - 20px);
    padding-top: 10px;
    padding-bottom: calc(34px + env(safe-area-inset-bottom));
  }

  .home-section-bar {
    flex-wrap: wrap;
  }

  .mini-button,
  .add-block-control select {
    min-height: 42px;
    font-size: 14px;
  }

  .dashboard-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    min-height: 164px;
    padding: 18px;
  }

  .block-controls button {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .tool-grid a {
    min-height: 122px;
    padding: 21px;
  }

  .tool-grid strong {
    font-size: 25px;
  }

  .fact-text {
    font-size: 20px;
  }

  .fact-actions .mini-button,
  .fact-key-form input,
  .fact-key-form .mini-button {
    min-height: 44px;
    font-size: 16px;
  }
}
