:root {
  color-scheme: light;
  --paper: #ffffff;
  --pressed: #eef1f2;
  --ink: #14181b;
  --muted: #59626a;
  --line: #d5dbdf;
  --accent: #17603f;
  --radius: 6px;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 30rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
}

h1,
h3,
p,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Controls */

button,
input,
select,
.link-button {
  min-height: 3.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

button,
.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

button:active,
.link-button:active {
  background: var(--pressed);
}

button[aria-pressed="true"],
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
  font-weight: 600;
}

button.primary {
  width: 100%;
}

button.primary:disabled {
  border-color: var(--line);
  background: var(--pressed);
  color: var(--muted);
  cursor: default;
}

.days {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.days button {
  flex: 1 1 30%;
  white-space: nowrap;
}

/* Parents' page */

.date {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.notice {
  margin-top: 1rem;
}

.notice:empty {
  display: none;
}

.loading {
  animation: appear 0s 0.8s both;
}

@keyframes appear {
  from {
    visibility: hidden;
  }
}

.bounds {
  margin-top: 0.75rem;
}

.pair {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 1rem;
}

.time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bounds dt,
.exercise {
  font-size: 1.25rem;
}

.bounds .time {
  font-size: clamp(3.75rem, 22vw, 6.5rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.no-classes {
  margin-top: 1.75rem;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.classes {
  margin-top: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.classes .pair {
  flex-wrap: nowrap;
  padding: 0.25rem 0;
}

/* The outline sits in the side margins, so the times stay in one column. */
.attended {
  margin: 0.25rem -0.75rem;
  padding: 0.25rem calc(0.75rem - 2px);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
}

.skipped {
  color: var(--muted);
}

.exercise {
  margin-top: 0.75rem;
}

.exercise .time {
  font-size: clamp(1.75rem, 9vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Admin page */

.sign-in {
  display: grid;
  gap: 0.75rem;
}

.sign-in input {
  width: 100%;
  padding: 0 0.875rem;
  font-size: 1.125rem;
}

.shifts {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.shifts button {
  min-height: 3.75rem;
  font-size: 1.125rem;
}

.range {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.range label {
  display: grid;
  flex: 1 1 0;
  gap: 0.375rem;
  min-width: 0;
}

.range select {
  width: 100%;
  min-height: 3.75rem;
  padding: 0 0.5rem;
  font-size: 1.125rem;
}

.attending {
  margin: 1rem 0 2rem;
}

.attending label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
  padding: 0.5rem 0;
  cursor: pointer;
  touch-action: manipulation;
}

.attending li:not([hidden]) ~ li {
  border-top: 1px solid var(--line);
}

.attending .time {
  display: block;
  color: var(--muted);
  font-size: 1rem;
}

.attending input {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  min-height: 0;
  margin: 0 0.25rem 0 0;
  accent-color: var(--accent);
}

.attending .off .name {
  color: var(--muted);
}

details {
  border-top: 1px solid var(--line);
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "Izmijeni";
  color: var(--accent);
  font-size: 1rem;
}

details[open] > summary::after {
  content: "Zatvori";
}

.editor {
  display: grid;
  gap: 0.75rem;
  padding: 0.5rem 0 2rem;
}

.editor h3 {
  font-size: 1.0625rem;
  font-weight: 600;
}

.fields {
  display: grid;
  align-items: center;
  gap: 0.5rem;
}

.fields.two {
  grid-template-columns: auto minmax(0, 1fr);
}

.fields.three {
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
}

.fields input {
  width: 100%;
  min-width: 0;
  padding: 0 0.75rem;
}

.fields.three input {
  padding: 0 0.25rem;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.fields .column {
  text-align: center;
}

.hint {
  color: var(--muted);
  font-size: 1rem;
}

.footer {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem 0 4rem;
  border-top: 1px solid var(--line);
}

.status {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
  text-align: center;
}

.status:empty {
  display: none;
}

.status.error {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
