* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  color-scheme: light;
  font: 14px/1.45 Arial, Helvetica, sans-serif;
}

.page {
  max-width: 1050px;
  margin: 20px 25px;
}

h1 {
  margin: 0 0 2px;
  font: bold 36px/1.45 Georgia, serif;
}

header p {
  margin: 0 0 12px;
}

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

h3 {
  font-size: 16px;
  margin: 0 0 5px;
}

p {
  margin: 8px 0;
}

button {
  font: inherit;
  color: #000;
  background: #fff;
  border: 1px solid #000;
  border-radius: 3px;
  padding: 6px 10px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  text-decoration: underline;
}

button:disabled {
  border-style: dashed;
  cursor: not-allowed;
}

button:focus-visible, #activity-content:focus-visible {
  outline: 2px solid #000;
  outline-offset: 3px;
}

.primary-button, .danger-button, .tabs button[aria-pressed="true"] {
  font-weight: bold;
}

.danger-button, .tabs button[aria-pressed="true"] {
  text-decoration: underline;
}

.header-buttons, .button-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-bar {
  margin-top: 20px;
  padding: 9px 0;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
}

#day-description {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.end-day {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.summary {
  display: flex;
  align-items: start;
  gap: 35px;
  margin-top: 13px;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: left;
  border-bottom: 1px solid #000;
  padding: 7px 8px;
  vertical-align: top;
}

.stats {
  width: auto;
  flex: 1;
}

.stats th, .stats td {
  padding: 4px 12px 4px 0;
  border: 0;
}

.stats th {
  font-weight: normal;
}

.stats td:nth-child(2) {
  font-weight: bold;
}

.stats td:last-child {
  font-size: 12px;
}

.goal {
  width: 285px;
  padding: 0 8px 0 0;
}

.goal strong {
  font-size: 23px;
  overflow-wrap: anywhere;
}

.goal p:last-child {
  font-size: 12px;
}

/* The native progress bar needs separate rules in Firefox and Chrome. */
progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 13px;
  border: 1px solid #000;
  background: #fff;
  accent-color: #000;
}

progress::-webkit-progress-bar {
  background: #fff;
}

progress::-webkit-progress-value {
  background: #000;
}

progress::-moz-progress-bar {
  background: #000;
}

.notice {
  margin: 16px 0 19px;
  padding: 7px 9px;
  border: 1px solid #000;
  background: #fff;
}

.notice.error {
  border-left-width: 4px;
  font-weight: bold;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 690px) minmax(0, 285px);
  gap: 28px;
  align-items: start;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

fieldset {
  min-width: 0;
  margin: 0 0 17px;
  padding: 9px 12px 12px;
  border: 1px solid #000;
  background: #fff;
}

legend {
  padding: 0 4px;
  font-weight: bold;
}

.job-details {
  margin: 8px 0 11px;
}

.extra th {
  width: 38%;
}

.extra td:last-child, .jobs td:last-child {
  text-align: right;
}

.jobs {
  font-size: 13px;
}

.jobs button {
  font-size: 12px;
  padding: 5px 8px;
}

.jobs .current th {
  text-decoration: underline;
}

.table-wrap {
  overflow-x: auto;
}

.section-title {
  margin: 23px 0 7px;
}

.intro {
  font-size: 13px;
  margin: 0 0 16px;
}

.study, .business, .market, .bank {
  padding: 0 0 15px;
  margin-bottom: 18px;
  border-bottom: 1px solid #000;
}

.business-owned {
  font-size: 12px;
  font-weight: normal;
  margin-left: 10px;
}

.business p, .study p, .market p, .bank p {
  font-size: 13px;
}

.business .button-row {
  margin-top: 9px;
}

.journal {
  padding-top: 5px;
}

aside h2 {
  font-size: 17px;
}

#log {
  list-style: none;
  margin: 0;
  padding: 0;
}

#log li {
  padding: 7px 0;
  border-bottom: 1px dotted #000;
  font-size: 12px;
  overflow-wrap: anywhere;
}

#log li span {
  font-weight: bold;
  margin-right: 6px;
}

.milestones {
  margin-top: 28px;
}

#milestones {
  padding-left: 18px;
  font-size: 12px;
}

#milestones li {
  padding-bottom: 8px;
}

#milestones li span:last-child {
  margin-left: 7px;
}

#milestones .reached {
  font-weight: bold;
}

.event {
  border: 1px solid #000;
  background: #fff;
  padding: 13px;
  margin-bottom: 18px;
}

.event .button-row {
  margin-top: 12px;
}

dialog {
  width: min(510px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  border: 1px solid #000;
  padding: 20px;
  background: #fff;
  color: #000;
}

dialog::backdrop {
  background: #fff;
}

.help-list {
  padding-left: 22px;
}

.help-list li {
  margin-bottom: 10px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .page {
    margin: 15px 12px;
  }

  .summary {
    flex-wrap: wrap;
    gap: 10px;
  }

  .stats {
    flex-basis: 100%;
  }

  .goal {
    width: 300px;
    max-width: 100%;
  }

  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .day-bar {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .extra td, .jobs th, .jobs td {
    padding: 7px 4px;
  }

  .extra button {
    max-width: 100%;
  }
  .jobs {
    min-width: 340px;
  }
}
