.greet {
  font-size: 26px !important;
}

.archive-print-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0 18px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.archive-print-actions span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 580px) {
  .archive-print-actions .btn {
    flex: 1 1 calc(50% - 5px);
    padding-inline: 10px;
  }

  .archive-print-actions span {
    flex-basis: 100%;
  }
}

.card h2 {
  font-size: 20px !important;
  line-height: 1.25 !important;
}

.card {
  border: 1px solid #cfd8d2 !important;
  box-shadow: 0 3px 14px #263b3508 !important;
}

.narrative,
#quick,
.toggleline,
.metric {
  border-color: #d4dcd7 !important;
}

.metric strong {
  font-size: 21px !important;
}

.story {
  font-size: 16px !important;
}

.capture {
  align-items: stretch;
}

#quick {
  width: 100%;
  min-height: 92px;
  flex: 1 1 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 13px 14px;
  font-size: 16px !important;
  line-height: 1.5;
  outline-color: #72a69a;
}

.capture-guidance {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

#captureStatus {
  line-height: 1.45;
}

.capture-mode {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 3px 8px;
  border-radius: 99px;
  background: #edf6f1;
  color: var(--teal);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.capture-option.selected {
  border-color: #5d9b8d !important;
  background: #edf6f1 !important;
  color: #276b61 !important;
}

#add.save-confirmed {
  background: #176a50 !important;
}

.narrative-note {
  color: var(--muted);
  font-size: 12px;
  margin: -7px 0 12px;
}

.study-picker-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
  padding: 16px;
  border: 1px dashed #9eb8ae;
  border-radius: 12px;
  background: #f8fbf9;
}

.study-picker-panel.dragging {
  border-color: var(--teal);
  background: #edf7f3;
}

.study-drop-copy {
  flex: 1 1 220px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.study-external-link {
  flex-basis: 100%;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.study-workspace-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -3px 0 16px;
}

.study-workspace-actions span {
  color: var(--muted);
  font-size: 12px;
}

.study-history {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.study-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.study-history-heading h3 {
  margin: 4px 0 5px;
  color: var(--ink);
  font: 700 20px/1.25 Georgia, serif;
}

.study-history-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.study-history-tools,
.study-history-row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.study-history-list {
  display: grid;
  gap: 10px;
}

.study-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #d4ddd8;
  border-radius: 11px;
  background: #fff;
}

.study-history-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.study-history-row span,
.study-history-row small {
  color: var(--muted);
  font-size: 11px;
}

.study-history-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.study-history-empty {
  margin: 0;
  padding: 16px;
  border: 1px dashed #becdc6;
  border-radius: 11px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.btn.danger {
  color: #8c3e3e;
  border-color: #d9b5b5;
}

@media (max-width: 620px) {
  .study-picker-panel .btn {
    width: 100%;
  }

  .study-drop-copy {
    flex-basis: 100%;
  }

  .study-workspace-actions .btn,
  .study-history-tools .btn {
    width: 100%;
  }

  .study-history-heading,
  .study-history-row {
    align-items: stretch;
    flex-direction: column;
  }

  .study-history-row-actions .btn {
    flex: 1 1 calc(33.333% - 6px);
  }
}

.mobile-more,
.mobile-nav-sheet {
  display: none;
}

.mobile-nav-sheet[hidden] {
  display: none !important;
}

@media (max-width: 580px) {
  .app {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .side {
    height: calc(70px + env(safe-area-inset-bottom)) !important;
    padding: 5px 8px env(safe-area-inset-bottom) !important;
  }

  .nav {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    height: 100%;
  }

  .nav button {
    min-width: 0;
    padding: 6px 3px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    font-size: 11px !important;
    line-height: 1;
  }

  .nav .ico {
    width: auto !important;
    font-size: 18px;
    line-height: 1;
  }

  .nav .label {
    display: block !important;
    max-width: 100%;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav .mobile-secondary {
    display: none !important;
  }

  .mobile-more {
    display: flex !important;
  }

  .mobile-nav-sheet {
    display: grid;
    position: fixed;
    z-index: 12;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: min(330px, calc(100% - 24px));
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffefa;
    box-shadow: 0 18px 60px #14231f38;
  }

  .mobile-nav-sheet-head {
    padding: 5px 9px 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
  }

  .mobile-nav-sheet button {
    width: 100%;
    min-height: 49px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 9px;
    align-items: center;
    padding: 10px 9px;
    text-align: left;
    font-weight: 650;
  }

  .sheet-icon {
    color: var(--gold);
    font-size: 19px;
    text-align: center;
  }

  .sheet-arrow {
    color: var(--muted);
    font-size: 24px;
  }

  .greet {
    font-size: 22px !important;
  }

  .card h2 {
    font-size: 18px !important;
  }

  .card {
    padding: 15px !important;
  }

  #quick,
  #add,
  #voice {
    width: 100%;
    flex-basis: 100%;
  }
}
