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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #202020;
  color: #f5f5f5;
  font-family: "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 0 0 env(safe-area-inset-bottom, 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

nav.site-bar {
  align-self: stretch;
  width: auto;
  margin-left: 0;
  margin-right: 0;
}

.account-header {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 16px 0 16px;
  border-bottom: 1px solid #3a3a3c;
}

.account-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.account-title {
  margin: 16px 16px 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #b8b8b8;
  text-align: center;
}

.account-main {
  width: 100%;
  max-width: 420px;
  flex: 1;
  padding: 16px 16px 24px;
  box-sizing: border-box;
}

.account-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-label {
  display: block;
  font-size: 0.9rem;
  color: #b8b8b8;
  margin-bottom: 6px;
}

.account-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  background: #121213;
  color: #f5f5f5;
  font-size: 1rem;
  font-family: inherit;
}

.account-input:focus {
  outline: 2px solid #538d4e;
  outline-offset: 1px;
  border-color: #538d4e;
}

.account-button {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  background: #538d4e;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.account-button:hover,
.account-button:focus-visible {
  background: #6aaa64;
}

.account-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.account-button--secondary {
  background: #3a3a3c;
  margin-top: 8px;
}

.account-button--secondary:hover,
.account-button--secondary:focus-visible {
  background: #565758;
}

.account-signed-in {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-signed-in[hidden] {
  display: none;
}

.account-subhead {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.account-status {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #b8b8b8;
  min-height: 1.45em;
}

.account-status--success {
  color: #6aaa64;
}

.account-status--error {
  color: #e87979;
}

.account-handle {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.account-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.account-photo-btn {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.account-photo,
.account-photo--empty {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: #3a3a3c;
  display: block;
}

.account-photo--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8b8b8;
}

.account-photo--letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.account-photo[hidden],
.account-photo--letter[hidden],
.account-photo--empty[hidden] {
  display: none;
}

.account-photo-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #538d4e;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #202020;
  box-sizing: border-box;
}

.account-handle-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.account-handle-edit .account-handle {
  margin: 0;
}

.account-handle-pencil {
  flex-shrink: 0;
  opacity: 0.7;
}

.account-handle-edit[hidden] {
  display: none;
}

.account-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #b8b8b8;
}

.account-row {
  width: 100%;
  text-align: left;
  padding: 14px;
  border: 1px solid #3a3a3c;
  border-radius: 12px;
  background: #242426;
  color: #f5f5f5;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.account-logout {
  width: 100%;
  padding: 12px;
  border: 0;
  background: transparent;
  color: #e87979;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.account-link {
  color: #6aaa64;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-link:hover,
.account-link:focus-visible {
  color: #8bc986;
}

.account-back {
  margin-top: 24px;
  text-align: center;
}

.account-back a {
  color: #b8b8b8;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-back a:hover,
.account-back a:focus-visible {
  color: #f5f5f5;
}

.account-loading {
  color: #b8b8b8;
  font-style: italic;
}

.photo-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

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

.photo-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 32, 32, 0.85);
}

.photo-crop-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 16px;
  border-radius: 16px;
  background: #242426;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.photo-crop-stage {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #3a3a3c;
  border-radius: 12px;
  touch-action: none;
}

.photo-crop-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.photo-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.photo-crop-actions .account-button,
.photo-crop-actions .account-logout {
  min-height: 44px;
  flex: 1 1 40%;
}
