#certificatesScreen {
  min-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}

.cert-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  width: fit-content;
  max-width: 100%;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
}

.cert-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  border-radius: 11px;
  cursor: pointer;
}

.cert-tab--active {
  background: var(--bg-card);
  color: var(--text-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.cert-tab-panel.hidden {
  display: none;
}

.cert-journal-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

.cert-journal-toolbar .input {
  min-width: 12rem;
  flex: 1;
}

.cert-journal-list {
  display: grid;
  gap: 0.75rem;
}

.cert-desk {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
}

.cert-desk__stage {
  width: 100%;
  max-width: 34rem;
  animation: certFadeIn 0.45s ease;
}

.cert-desk__stage.hidden {
  display: none;
}

@keyframes certFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cert-window {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 22px;
  padding: 2.1rem 1.8rem 1.7rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.cert-window__kicker {
  margin: 0 0 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--lime);
}

.cert-window__title {
  margin: 0 0 0.55rem;
  font-family: var(--ff-heading);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: -0.03em;
}

.cert-window__lead {
  margin: 0 auto 1.4rem;
  max-width: 22rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.cert-window__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-window__form input {
  width: 100%;
  height: 3.4rem;
  padding: 0 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-size: 1.28rem;
  letter-spacing: 0.04em;
  text-align: center;
  font-family: inherit;
}

.cert-window__form input:focus {
  outline: none;
  border-color: var(--lime);
  box-shadow: 0 0 0 4px var(--lime-dim);
}

.cert-window__status {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cert-window__status.is-error {
  color: var(--danger);
}

.cert-window__submit {
  height: 3.15rem;
  border: 0;
  border-radius: 14px;
  background: var(--lime);
  color: var(--accent-contrast);
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.cert-window__submit:hover {
  background: var(--lime-hover);
  transform: translateY(-1px);
}

.cert-window__submit:disabled {
  opacity: 0.6;
  transform: none;
  cursor: wait;
}

.cert-back {
  display: inline-flex;
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  cursor: pointer;
}

.cert-back:hover {
  color: var(--text-strong);
}

.cert-result {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cert-person {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.25rem 1.3rem;
}

.cert-person__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  font-weight: 600;
}

.cert-person__name {
  margin: 0;
  font-family: var(--ff-heading);
  font-size: 1.45rem;
  color: var(--text-strong);
}

.cert-person__meta {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cert-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.2rem 1.3rem 1.1rem;
}

.cert-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.cert-item__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cert-item__amount {
  margin: 0;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-strong);
  font-family: var(--ff-heading);
}

.cert-item__sub {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.cert-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.95rem;
}

.cert-empty {
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: 20px;
  padding: 1.6rem 1.2rem;
  text-align: center;
  color: var(--text-muted);
}

.cert-kind {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.cert-kind__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  margin: 0;
  padding: 0 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-weight: 600;
  cursor: pointer;
}

.cert-kind__item:has(input:checked) {
  border-color: var(--lime);
  box-shadow: 0 0 0 3px var(--lime-dim);
}

.cert-service-source {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.7rem;
}

.cert-service-source__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  margin: 0;
  padding: 0 0.7rem;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-strong);
  font-weight: 600;
  cursor: pointer;
  transition-property: border-color, background-color, box-shadow;
  transition-duration: 150ms;
  transition-timing-function: ease-out;
}

.cert-service-source__item:has(input:checked) {
  border-color: var(--lime);
  background: color-mix(in srgb, var(--lime) 7%, var(--bg-elevated));
  box-shadow: 0 0 0 3px var(--lime-dim);
}

.cert-service-visibility-hint {
  margin: 0.45rem 0 0.8rem;
  text-wrap: pretty;
}

.cert-item__title {
  margin: 0.15rem 0 0.2rem;
  color: var(--lime);
  font-weight: 600;
  font-size: 0.95rem;
}

.cert-amount-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}

html.mobile-console .cert-desk {
  align-items: flex-start;
  padding-top: 1.25rem;
}
