*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: #008080;
}

body { font-size: 12px; }

.desktop {
  min-height: 100vh;
  padding: 24px 12px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.survey-window {
  width: 100%;
  max-width: 520px;
}

.window-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.window-body fieldset {
  margin: 0;
  min-width: 0;
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-row-stacked {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-row-stacked label {
  font-size: 12px;
}

.other-row {
  margin-top: 8px;
}

.window-body input[type="text"],
.window-body textarea {
  width: 100%;
  font-family: inherit;
  box-sizing: border-box;
}

.window-body textarea {
  resize: vertical;
  min-height: 60px;
}

.calendar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  user-select: none;
  -webkit-user-select: none;
}

.month-header {
  text-align: center;
  font-weight: bold;
  font-size: 11px;
  padding: 1px 0;
  margin-bottom: 3px;
  background: #000080;
  color: #fff;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  padding: 2px;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #0a0a0a;
}

.dow {
  text-align: center;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 0;
  color: #000;
}

.day {
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 10px;
  padding: 0;
  background: #c0c0c0;
  color: #000;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  border: none;
  box-shadow:
    inset -1px -1px 0 0 #808080,
    inset 1px 1px 0 0 #fff;
}

.day:not(.past):not(.empty) {
  touch-action: none;
}

.day.empty {
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.day.selected {
  background: #000080;
  color: #fff;
  font-weight: bold;
  box-shadow:
    inset -1px -1px 0 0 #808080,
    inset 1px 1px 0 0 #fff;
}

.day.past {
  color: #808080;
  pointer-events: none;
}

.day:not(.past):not(.empty):active {
  box-shadow:
    inset 1px 1px 0 0 #808080,
    inset -1px -1px 0 0 #fff;
}

.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.actions button {
  min-width: 90px;
}

.status-bar-field.ok { color: #006400; font-weight: bold; }
.status-bar-field.err { color: #a00000; font-weight: bold; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-overlay[hidden] { display: none; }

.dialog {
  width: 100%;
  max-width: 320px;
}

.dialog-message {
  margin: 0 0 12px;
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.dialog-actions button { min-width: 80px; }
