/* Study log: floating link on practice pages + the daily report page. */

.study-log-fab {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--study-log-ink, #22392c);
  border-radius: 999px;
  background: var(--study-log-ink, #22392c);
  color: var(--study-log-paper, #ffffff);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.study-log-fab b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--study-log-paper, #ffffff);
  color: var(--study-log-ink, #22392c);
  font-size: 0.74rem;
  line-height: 1;
}

.study-log-fab:hover {
  background: var(--study-log-paper, #ffffff);
  color: var(--study-log-ink, #22392c);
}

.study-log-fab:hover b {
  background: var(--study-log-ink, #22392c);
  color: var(--study-log-paper, #ffffff);
}

/* ---- report page ---- */

.study-log-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  line-height: 1.7;
}

.study-log-page .study-log-back {
  display: inline-block;
  margin-bottom: 16px;
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
}

.study-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  margin-bottom: 20px;
}

.study-log-field {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.study-log-field-grow {
  flex: 1 1 260px;
}

.study-log-field select,
.study-log-field input {
  font: inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  background: #fff;
  color: inherit;
}

.study-log-report {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 28px 28px 20px;
}

.study-log-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #22392c;
  margin-bottom: 16px;
}

.study-log-head h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.study-log-day {
  font-weight: 400;
  margin-left: 8px;
  font-size: 1.1rem;
}

.study-log-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.study-log-stats div {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
}

.study-log-stats span {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.study-log-stats strong {
  font-size: 1.5rem;
  line-height: 1.2;
}

.study-log-stats em {
  font-style: normal;
  font-size: 0.8rem;
  margin-left: 4px;
  opacity: 0.7;
}

.study-log-report h2 {
  margin: 22px 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.study-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.study-log-table th,
.study-log-table td {
  text-align: left;
  vertical-align: top;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.study-log-table th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #22392c;
  white-space: nowrap;
}

.study-log-entries td:nth-child(1),
.study-log-entries td:nth-child(2) {
  white-space: nowrap;
  opacity: 0.7;
}

.study-log-entries tr.is-ok td:last-child {
  color: #2f7a4f;
  font-weight: 700;
}

.study-log-entries tr.is-ng td:last-child,
.study-log-entries tr.is-error td:last-child {
  color: #b5541c;
  font-weight: 700;
}

.study-log-entries tr.is-warn td:last-child {
  color: #c98a1e;
  font-weight: 700;
}

.study-log-detail {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.7;
  overflow-wrap: anywhere;
}

.study-log-empty {
  margin: 8px 0 20px;
  padding: 16px;
  border: 1px dashed rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.study-log-note textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  resize: vertical;
}

.study-log-note-print {
  display: none;
  white-space: pre-wrap;
}

.study-log-foot {
  margin-top: 20px;
  font-size: 0.75rem;
  opacity: 0.6;
}

.study-log-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.study-log-actions button,
.study-log-actions a {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #22392c;
  border-radius: 999px;
  background: #22392c;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.study-log-actions button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.study-log-actions .study-log-danger {
  background: transparent;
  color: #b5541c;
  border-color: #b5541c;
}

.study-log-hint,
.study-log-message {
  flex-basis: 100%;
  margin: 4px 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.study-log-message:empty {
  display: none;
}

@media (max-width: 600px) {
  .study-log-report {
    padding: 18px 14px;
  }

  .study-log-table {
    font-size: 0.82rem;
  }

  .study-log-table th,
  .study-log-table td {
    padding: 6px 5px;
  }
}

@media print {
  .study-log-fab,
  .no-print {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
  }

  .study-log-page {
    max-width: none;
    padding: 0;
  }

  .study-log-report {
    border: 0;
    border-radius: 0;
    padding: 0;
  }

  .study-log-note-print {
    display: block;
  }

  .study-log-entries tr {
    break-inside: avoid;
  }
}
